Load error when running rails console -


I am using Rails 4.1 and Ruby 2.1.1

Everything works, But when I run the rail I get this error

  & gt; Rail Console Development Environment (Rail 4.1.0) Load Error: /home/andreas/.rvm/rubies/ruby-2.1.1/.irbrc NoMethodError: 'partition' for the undefined method zero: NilClass /home/andreas/.rvm /scripts/irbrc.rb41:in `& lt; Top (required) & gt; '  

The console opens after the error and can be used.

41. The line and surroundings are in the .irbrc file.

  39 # Calculate the Ruby string. 40 rvm_ruby_string = ENV ["rvm_ruby_string"] || 41 (ENV ['GM_HOME'] & amp; NIV ['GM_Home]'] Partition (/ \) Last Split (/ @ /). First) || 42 ("# {RUBY_VERSION} -p # {RUBY_PATCHLEVEL}" Rescue zero) || 43 (RUBY_DESCRIPTION.split ("") [1] .sub ('p', '-p') Rescue zero) || 44 (`Ruby -V` || '') .split (" ") [1] .sub ('p', '-p')   

Meet in the console

  irb (main): 008: 0> ENV ['GEM_HOME'] = & gt; "" IRB (Main): 00 9: 0> ENV ['GEM_HOME']. the division (/ \ //). Final = & gt; Zero   

If I run an IRB outside the Rail application, then I

  2.1.1: 001 & gt; ENV ['GEM_HOME'] = & gt; "/home/andreas/.rvm/gems/ruby-2.1.1" 2.1.1: 002 & gt; ENV ['GEM_HOME']. the division (/ \ //). Final = & gt; "Ruby -1.1.1"   

Do you know why the environmental variable in the railway application is empty?

If you have to face this problem you should restart the computer .

Bin / spring file sets ANV ["GEM_HOME"] in an empty string

bin / spring

  11 INV ["GEM_PATH "] = ([Bundler.bundle_path.t_s] + mpath) .join (file :: PATH_SEPARATOR) 12 ENV [" GEM_HOME "] =" "13 hrs paths = ENV   

It crashes while crashing the rail, because in line 41

  ENV ['GEM_HOME'] Split (/ \ //). last   

if ENV ['GEM_HOME'] is empty

~ / .rvm / rubies / ruby-2.1.1 / .irbrc 39 # Calculate Ruby String 40 rvm_ruby_string = ENV ["rvm_ruby_string"] || 41 (ENV ['GM_HOME'] & amp; NIV ['GM_Home]'] Partition (/ \) Last Split (/ @ /). First) || 42 ("# {RUBY_VERSION} -p # {RUBY_PATCHLEVEL}" Rescue zero) || 43 (RUBY_DESCRIPTION.split ("") [1] .sub ('p', '-p') Rescue zero) || 44 (`ruby -v` || '') .split (" ") [1] .sub ('p', '-p')

string to set rvm Uses a quick message in the console If you change the line 12 into bin / spring then

  ENV ["GEM_HOME"] = "Spring is great!"   

You get this good prompt

  Bin / rails c Development environments (Rail Rail 4.1.0) Spring is great! : 001 & gt;   

I really do not understand why ENV ["GEM_HOME"] is set to an empty string, so, to get rid of this error I change it. I have posted an issue on the Spring Geeth page.

Be careful!

When you run springbustb , any changes in the bin / spring file will be lost

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -