升级RVM后,Ruby和Rails出现此错误(我使用的是Ubuntu 14.04 LTS):
☁ ~ irb
load error: /home/patrick/.rvm/rubies/ruby-2.1.2/.irbrc
NoMethodError: undefined method `split' for nil:NilClass
/home/patrick/.rvm/scripts/irbrc.rb:45:in `<top (required)>'
/home/patrick/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/patrick/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/patrick/.rvm/rubies/ruby-2.1.2/.irbrc:11:in `<top (required)>'
/home/patrick/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/init.rb:236:in `load'
/home/patrick/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/init.rb:236:in `run_config'
/home/patrick/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/init.rb:19:in `setup'
irb(main):001:0>
为了解决这个问题,我每次都需要运行以下命令:
rvm gemset use default --default
我试过..
--default
,但不是ruby,rails,rvm和gem --version
☁ ~ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
☁ ~ rails --version
Rails 4.1.2.rc1
☁ ~ rvm --version
rvm 1.25.27 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
☁ ~ gem --version
2.2.2
☁ ~
$ GEM_HOME
/home/patrick/.rvm/gems/ruby-2.1.2@rails4
$ GEM_PATH
/home/patrick/.rvm/gems/ruby-2.1.2@rails4:/home/patrick/.rvm/gems/ruby-2.1.2@global
$ PATH
/home/patrick/.rvm/gems/ruby-2.1.2@rails4/bin:
/home/patrick/.rvm/gems/ruby-2.1.2@global/bin:
/home/patrick/.rvm/rubies/ruby-2.1.2/bin:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/home/patrick/.rvm/bin:
/home/patrick/.rvm/bin:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/usr/local/games:
/home/patrick/.rvm/bin
.zshrc(oh-my-zsh)
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
如果您需要更多信息,请与我们联系。
感谢。