NoMethodError: undefined method `cache' for Gem:Module

Posted . Visible to the public.

I got this error when running Rails 2.3 tests for Rails LTS. More stacktrace:

NoMethodError: undefined method `cache' for Gem:Module
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:212:in `each'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:146:in `to_a'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:146:in `cache'
    /opt/vagrant_ruby/lib/ruby/1.8/fileutils.rb:243:in `inject'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:146:in `each'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:146:in `inject'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:146:in `cache'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:127:in `lookup'
    /vagrant/rails-2-3-lts-repository/railties/lib/rails_generator/lookup.rb:140:in `instance'

You probably use a quite new version of RubyGems (I had 2.5.1 when encountering this).

The solution: Downgrade RubyGems to version 1.8.25:

gem update --system 1.8.25
Thomas Eisenbarth
Last edit
Thomas Eisenbarth
License
Source code in this card is licensed under the MIT License.
Posted by Thomas Eisenbarth to makandra dev (2016-01-26 08:56)