我在我的Rails应用程序(设计)上安装了一个gem.安装宝石后,我意识到我不需要它.
我想删除gem,它的依赖项以及它在我的应用程序上创建的文件.换句话说,我想将系统恢复到以前在gem之前的状态.我怎样才能做到这一点?(我正在使用Ruby on Rails 3.)
我正在尝试使用远程Glassfish服务器(版本3.1.1(版本12))上的Cargo Maven插件部署Web应用程序.Glassfish服务器以及位于不同Linux服务器(Ubuntu)上的Java代码.我已经在pom文件中配置了所有必需的属性,并在Windows机器上进行了测试部署.有用.但它在Linux Ubuntu上失败了,有一个有趣的例外:
27-Jun-2012 14:36:05 [ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy (default-cli) on project my-web-project-app: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null -> [Help 1]
27-Jun-2012 14:36:05 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy (default-cli) on project mca-staff-app: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.1:deploy failed: Deployment has failed: null
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
27-Jun-2012 14:36:05 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
27-Jun-2012 14:36:05 …
Run Code Online (Sandbox Code Playgroud) 我有一个奇怪的问题.我正在使用窗口的null布局(= JFrame和Windows),如果我使用setResizable(false),窗口大小会变大(向右和向下,我会说大约10个像素).我不知道为什么.
这两个println返回相同的尺寸,有什么奇怪的,也......
mainWnd.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWnd.setTitle(wndTitle);
mainWnd.setBounds(wndPosX, wndPosY, wndWidth, wndHeight);
System.out.println(mainWnd.getHeight() + mainWnd.getWidth());
mainWnd.setResizable(false);
System.out.println(mainWnd.getHeight() + mainWnd.getWidth());
Run Code Online (Sandbox Code Playgroud)
有人有想法吗?为什么窗口会调整大小?
更新:同样的事情(使用和不使用setResizable编译它,如果你重叠窗口,你可以看到它):
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Main
{
private static JFrame mainWnd = null;
public static void main(String[] args)
{
mainWnd = new JFrame();
mainWnd.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWnd.setTitle("asda");
mainWnd.setBounds(50, 50, 300, 300);
mainWnd.setResizable(false);
mainWnd.setVisible(true);
}
}
Run Code Online (Sandbox Code Playgroud) 我使用的是Ubuntu 12.04.我想在我的系统上安装LESS.谁能告诉我如何安装LESS
?
我安装gem install passenger
了我的rails应用程序.现在我试试passenger-install-apache2-module
.
我收到错误屏幕:
所需软件的安装说明
- 要安装Apache 2开发标头:请以root身份运行apt-get install apache2-prefork-dev.
- 要安装Apache Portable Runtime(APR)开发标头:请以root身份运行apt-get install libapr1-dev.
- 要安装Apache Portable Runtime Utility(APU)开发标头:请以root身份运行apt-get install libaprutil1-dev.
当我跑步时sudo apt-get install apache2-prefork-dev
,我明白了
以下软件包具有未满足的依赖项:apache2-prefork-dev:取决于:apache2.2-common(= 2.2.22-1ubuntu1),但要安装2.2.22-1ubuntu1.1.
E:无法纠正问题,你已经破了包裹.
当我跑步时sudo apt-get update
,它没有解决任何问题.错误仍然存在.
我在尝试时在终端窗口中收到此错误
$ gvim
** (gvim:2350): WARNING **: Unable to create Ubuntu Menu Proxy: Timeout was reached
Run Code Online (Sandbox Code Playgroud)
gvim启动,但然后发生此错误.任何帮助是极大的赞赏.
当我尝试通过以下命令在Ubuntu 11.04中安装autoconf时
sudo apt-get install autoconf
Run Code Online (Sandbox Code Playgroud)
这个错误来了
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package autoconf is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'autoconf' has no installation candidate
Run Code Online (Sandbox Code Playgroud)
如何删除此错误并安装它?
我刚刚安装了Ubuntu 12.04,我也安装了PHP.默认情况下,它与版本5.3.10一起安装,但我的PHP项目不支持PHP v5.3.10.
我想将PHP版本降级到5.2.我该怎么做?
我只是在Python中学习编程以获得乐趣.我正在写一个回文程序,我想到了如何进一步改进它.
我想到的第一件事是防止程序必须双向浏览整个单词,因为我们只是检查回文.然后我意识到只要第一个和最后一个字符不匹配就可以打破循环.
然后我在课堂上实现它们,这样我就可以调用一个单词并返回true或false.
这就是该计划截至目前的情况:
class my_str(str):
def is_palindrome(self):
a_string = self.lower()
length = len(self)
for i in range(length/2):
if a_string[i] != a_string[-(i+1)]:
return False
return True
this = my_str(raw_input("Enter a string: "))
print this.is_palindrome()
Run Code Online (Sandbox Code Playgroud)
我是否可以进行其他任何改进以提高效率?
我有以下系统:
Linux 64位LTS 12.04
尽管在尝试执行项目时可以构建项目,但它会出现以下错误:
OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in release, file /build/buildd /opencv-2.3.1/modules/core/src/matrix.cpp, line 1364
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp:1364: error: (-215) k == STD_VECTOR_MAT in function release
Run Code Online (Sandbox Code Playgroud)
令人困惑的是我无法找到错误中指定的路径,即
/build/buildd/opencv-2.3.1/modules/core/src/matrix.cpp
Run Code Online (Sandbox Code Playgroud)
我可以使用命令行工具gcc和pkg-config编译相同的源代码。但是,我无法通过Eclipse IDE进行相同的操作。