Gem安装错误:NameError

时间:2011-08-23 03:07:23

标签: ruby gem osx-lion macos

自从我更新到Mac OSX Lion以来,我还没有能够安装任何Gem。 每次我尝试安装任何宝石时,终端窗口都会挂起。 我已经卸载了所有内容,包括ruby和重新安装的Ruby Gems,但这并没有解决问题。

跑步后: gem install rails --debug 我得到了这个(只显示了第一行):

Exception `NameError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
Exception `LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- psych
Exception `LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:62 - no such file to load -- psych
Exception `Errno::EEXIST' at /opt/local/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/marcogallen/.gem/specs/rubygems.org%80
Exception `Errno::EEXIST' at /opt/local/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/marcogallen/.gem/specs/gems.github.com%80
Exception `EOFError' at /opt/local/lib/ruby/1.8/net/protocol.rb:135 - end of file reached
Exception `EOFError' at /opt/local/lib/ruby/1.8/net/protocol.rb:120 - end of file reached
Exception `EOFError' at /opt/local/lib/ruby/1.8/net/http.rb:1060 - end of file reached

GEM env给出了这个:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.8
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11]
  - INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /opt/local/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-11
  - GEM PATHS:
     - /opt/local/lib/ruby/gems/1.8
     - /Users/[user]/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://gems.github.com

我在这里完全无能为力,我希望有人可以给我一些暗示。 运行OSX Lion的MAC Book PRO

由于 马可

1 个答案:

答案 0 :(得分:0)

嘿,我有一个非常类似的问题,

我使用RVM Click here!

升级到Ruby 1.9.2

它有自己的方式来管理每个Ruby实例的Gems并帮助我了解宝石的保存位置等等......如果你有阅读,你应该到达那里!

如果它没有帮助我很抱歉,但可能值得一试!