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

情到浓时终转凉″ 提交于 2019-12-10 09:26:35

问题


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

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

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

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?


回答1:


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

Now JRuby 131 has been added to my pik.

Regards



来源:https://stackoverflow.com/questions/11425163/pik-error-private-method-gsub-called-for-nilnilclass

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!