0

Rubygems NoMethodError(Ruby 1.8) 出现错误。

这些是旧的 Rails 2.3 站点,所以我希望不必升级到 1.9。

它发生在所有 gem 命令中,包括gem -v.

错误是rubygems.rb:959:in '_deprecated_source_index': undefined method 'dirs' for Gem::Specification:Class (NoMethodError)

这是完整的堆栈跟踪:

NOTE: Gem.searcher is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.searcher called from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb:81.
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:959:in `_deprecated_source_index': undefined method `dirs' for Gem::Specification:Class (NoMethodError)
    from /usr/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:39:in `skip_during'
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:958:in `_deprecated_source_index'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:63:in `send'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:63:in `source_index'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_path_searcher.rb:13:in `initialize'
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:951:in `new'
    from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:951:in `_deprecated_searcher'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:63:in `send'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:63:in `searcher'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:50
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:8
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/bin/gem:9
4

1 回答 1

0

降级您的红宝石。您必须直接从源代码安装它,因为您的 gem 命令不起作用。

我自己使用 Ruby 1.8.7,到目前为止似乎运行良好的 ruby​​gems 版本是 1.6.0。

http://rubyforge.org/frs/?group_id=126

于 2012-05-15T12:29:44.800 回答