Posted over 1 year ago. Visible to the public.

NoMethodError: undefined method `cache' for Gem:Module

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

Copy
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:

Copy
gem update --system 1.8.25

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Author of this card:

Avatar
Thomas Eisenbarth
Last edit:
over 1 year ago
by Thomas Eisenbarth
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Thomas Eisenbarth to makandropedia