我使用 RVM(v1.14.11 和 JewelryBox GUI)和 OSX 10.6.8 已经一年多了,没有任何问题。我安装了两个红宝石(1.9.2 和 1.9.3),以及每个红宝石的各种宝石组。
由于我刚刚完成将当前数据库迁移到他们的新产品,我想我也可以更新 heroku gem(2.14)。所以我通过 rvm 选择了我的 ruby-1.9.2-p290@rails gemset,打开终端,然后运行“heroku udpate”。
在更新过程中我没有发现任何错误,但我尝试运行“heroku 版本”以及各种其他“heroku”命令,现在收到以下错误:
/Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- netrc (LoadError)
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.heroku/client/lib/heroku/auth.rb:6:in `<top (required)>'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.heroku/client/lib/heroku/client.rb:4:in `<top (required)>'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails/gems/heroku-2.14.0/lib/heroku.rb:6:in `<top (required)>'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails/gems/heroku-2.14.0/bin/heroku:6:in `<top (required)>'
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails/bin/heroku:19:in `load'
from /Users/me/.rvm/gems/ruby-1.9.2-p290@rails/bin/heroku:19:in `<main>'
我注意到上面有一些对“1.9.1”的引用,这是我用 rvm 安装的原始 gemset,然后将其更新为“1.9.2”。也许这就是原因?
运行“宝石环境”给出:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.10
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin10.8.0]
- INSTALLATION DIRECTORY: /Users/me/.rvm/gems/ruby-1.9.2-p290@rails
- RUBY EXECUTABLE: /Users/me/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/me/.rvm/gems/ruby-1.9.2-p290@rails/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-10
- GEM PATHS:
- /Users/me/.rvm/gems/ruby-1.9.2-p290@rails
- /Users/me/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
我确实有另一个gemset(ruby-1.9.3-p194@rails32),它也包含“heroku”gem,当我使用rvm切换到它时,使用它的“heroku”gem没有问题。
由于 rvm/osx 安装有时可能是“喜怒无常的”,或者至少在过去是这样,我真的可以就出了什么问题提出一些建议,以及如何安全地修复损坏的 gemset。
谢谢。