[英]Error while installing jruby on windows 7
I am trying to install JRuby in my system, I follow the following steps: 我试图在系统中安装JRuby,请按照以下步骤操作:
JRUBY_HOME = C:/jruby-1.7.2
创建这些: JRUBY_HOME = C:/jruby-1.7.2
;C:\\jruby-1.1.5\\bin;
添加;C:\\jruby-1.1.5\\bin;
to the end of that variable. 到该变量的末尾。 And then I am running the command: 然后我运行命令:
C:\Users\sitanshu\rubyApp\jruby-1.7.2>jruby -v
then it shows the following error: 然后显示以下错误:
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) Client VM 1.7.0-ea-b19 [Windows Vista-x86]
NameError: uninitialized constant Java::JavaLang::ProcessBuilder::Redirect
const_missing at org/jruby/RubyModule.java:2677
ProcessManager at file:/C:/Users/sitanshu/rubyApp/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manager.rb:12
JRuby at file:/C:/Users/sitanshu/rubyApp/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manager.rb:6
(root) at file:/C:/Users/sitanshu/rubyApp/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manager.rb:3
load at org/jruby/RubyKernel.java:1046
(root) at file:/C:/Users/sitanshu/rubyApp/jruby-1.7.2/lib/jruby.jar!/jruby/kernel.rb:1
So where am I going wrong and what is the solution for that? 那么,我哪里出问题了,那该怎么办呢?
我将测试Java是否已更新并正常工作
java -version
Under your environment variables, make sure you have a JAVA_HOME
variable pointing to your JRE root folder, like this: 在环境变量下,确保您有一个指向JRE根文件夹的JAVA_HOME
变量,如下所示:
C:\\Program Files\\Java\\jre7\\
Make sure your Java JRE bin folder is also part of your PATH
variable: 确保您的Java JRE bin文件夹也是PATH
变量的一部分:
;C:\\Program Files\\Java\\jre7\\bin\\
Additionally, when you are adding jruby to your PATH
variable, make sure you are referencing the correct folder location. 此外,在将jruby添加到PATH
变量时,请确保引用的文件夹位置正确。 In the example you have given, you are installing jruby to C:\\jruby-1.7.2
, but then you are actually referring to this different folder C:\\jruby-1.1.5
in your PATH
configuration. 在您给出的示例中,您正在将jruby安装到C:\\jruby-1.7.2
,但是实际上您是在PATH
配置中引用了这个不同的文件夹C:\\jruby-1.1.5
。
Also, when you are defining your JRUBY_HOME variable, make sure you are using backslash \\
characters. 另外,在定义JRUBY_HOME变量时,请确保使用反斜杠\\
字符。 In your example above you used a forward slash /
character. 在上面的示例中,您使用了正斜杠/
字符。 Remember, that windows uses backslashes between folders. 请记住,Windows在文件夹之间使用反斜杠。
Finally, after you've made all your environment variable changes, remember to open a new command window for your changes to take effect. 最后,在完成所有环境变量的更改后,请记住打开新的命令窗口以使更改生效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.