【问题标题】:Gem Install Error: NameErrorGem 安装错误:NameError
【发布时间】:2011-11-01 14:57:06
【问题描述】:

自从我更新到 Mac OSX Lion 后,我无法安装任何 Gem。 每次我尝试安装任何 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

谢谢 马可

【问题讨论】:

    标签: ruby gem osx-lion macos


    【解决方案1】:

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

    我使用 RVM Click here! 升级到 Ruby 1.9.2

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

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

    【讨论】:

    • 感谢 Charlie,遗憾的是这并没有起到作用,我为所有 Ruby 和 Gems 重新安装了。
    • 这就是我的建议!很高兴你到了那里
    猜你喜欢
    • 2018-05-21
    • 1970-01-01
    • 2012-12-21
    • 2017-04-18
    • 2011-08-12
    • 2011-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多