通过rvm从ruby -1.8.7-p352更新到ruby-1.8.7-p358 后,gems 仍然安装到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的路径,并且 gem 安装到了这个路径。