本文介绍了pik错误:专用方法`gsub'调用了nil:NilClass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向pik添加JRuby 1.3.1时出现错误.错误:

I´m getting an error when adding JRuby 1.3.1 to pik. Error:

Error: private method `gsub' called for nil:NilClass

这是我的路径环境变量:

this is my path environment variable:

C:\Users\Owner>echo %path%
C:\Program Files\Java\jdk1.7.0_05\bin;c:\jruby-1.7.0.preview1\bin;C:\jruby-1.3.1\bin;c:\pik

这是在尝试添加1.3.1版本时:

this is when trying to add 1.3.1 version:

C:\Users\Owner>pik add C:\jruby-1.3.1\bin

There was an error.
 Error: private method `gsub' called for nil:NilClass

  in: pik/commands/command.rb:124:in `get_version'
  in: pik/commands/add_command.rb:23:in `add'
  in: pik/commands/add_command.rb:13:in `execute'
  in: pik_runner:33

添加JRuby 1.7.0版本不是这种情况.

It´s not the case when adding JRuby 1.7.0 version.

我之前在pik中添加了JRuby 1.3.1,但是我不知道这次可能导致此错误的原因.有什么想法吗?

I have added JRuby 1.3.1 before to pik, but I don´t know what might be causing this error this time. Any ideas?

推荐答案

我运行命令pik run PATH并显示以下结果:

I run the command pik run PATH with this result:

C:\Users\Owner>pik run PATH
Cannot locate Java installation, specified by JAVA_HOME:
C:\Program Files\Java\jdk1.7.0_05\**bin**

因此已添加到环境变量->用户变量

So added to environment variables -> User variables

JAVA_HOME C:\Program Files\Java\jdk1.7.0_05

现在JRuby 131已添加到我的pik中.

Now JRuby 131 has been added to my pik.

致谢

这篇关于pik错误:专用方法`gsub'调用了nil:NilClass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-23 10:40