通过 rvm 从 ruby-1.8.7-p352 更新到 ruby-1.8.7-p358 后,仍然安装了宝石 ruby-1.8.7-p352 的路径。
$GEM_PATH
设置正确但rvm gemdir
错误。
# rvm use ruby-1.8.7-p358
Using /usr/local/rvm/gems/ruby-1.8.7-p358
# ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
# echo $GEM_PATH
/usr/local/rvm/gems/ruby-1.8.7-p358:/usr/local/rvm/gems/ruby-1.8.7-p358@global
# rvm gemdir
/usr/local/rvm/gems/ruby-1.8.7-p352
安装gems工作没有错误,但gem的位置错误,无法执行二进制文件。
# gem instll bundler
Successfully installed bundler-1.1.3
1 gem installed
# bundle
bash: bundle: command not found
# which bundle
/usr/bin/which: no bundle in (/usr/local/rvm/gems/ruby-1.8.7-p358/bin:/usr/local/rvm/gems/ruby-1.8.7-p358@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p358/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
# gem which bundler
/usr/local/rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.3/lib/bundler
我尝试export GEM_HOME=/usr/local/rvm/gems/ruby-1.8.7-p358
,但rvm gemdir
仍显示 p358 的路径,并且宝石已安装到此路径。
答案 0 :(得分:2)
更新rubygems解决了这个问题:
# rvm rubygems latest