Ruby版本和Ruby环境不匹配

时间:2013-11-05 22:21:19

标签: ruby-on-rails ruby rvm

我有一些问题,我的宝石是从特定版本的Ruby的错误目录中引用的。我为ruby-1.8.7-p374创建了一个rvm gemset,但是安装gem会将它们放在ruby-1.9.3-p392的目录中。

$ rvm current

ruby-1.8.7-p374

$ gem environment

RubyGems Environment:
- RUBYGEMS VERSION: 2.0.5
- RUBY VERSION: 1.9.3 (2013-02-22 patchlevel 392) [x86_64-darwin11.4.2]
- INSTALLATION DIRECTORY: /Users/jason/.rvm/gems/ruby-1.9.3-p392
- RUBY EXECUTABLE: /Users/jason/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
- EXECUTABLE DIRECTORY: /Users/jason/.rvm/gems/ruby-1.9.3-p392/bin
- RUBYGEMS PLATFORMS:
   - ruby
   - x86_64-darwin-11
- GEM PATHS:
   - /Users/jason/.rvm/gems/ruby-1.9.3-p392
   - /Users/jason/.rvm/gems/ruby-1.9.3-p392@global
- GEM CONFIGURATION:
   - :update_sources => true
   - :verbose => true
   - :backtrace => false
   - :bulk_threshold => 1000
   - "gem" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
   - https://rubygems.org/

$ rvm gemdir

/Users/jason/.rvm/gems/ruby-1.9.3-p392

1 个答案:

答案 0 :(得分:1)

GEM_PATH / GEM_HOME的shell配置可能与PATH不同步,修复它只是运行:

rvm use ruby-1.9.3-p392

OR:

rvm use ruby-1.8.7-p374