0

通过rvmruby ​​-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 安装到了这个路径。

4

1 回答 1

2

更新 ruby​​gems 解决了这个问题:

# rvm rubygems latest
于 2012-05-26T09:52:42.207 回答