gem安装在不同patchlevel的目录中

时间:2012-05-19 10:04:09

标签: ruby gem rvm

通过 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 的路径,并且宝石已安装到此路径。

1 个答案:

答案 0 :(得分:2)

更新rubygems解决了这个问题:

# rvm rubygems latest