Search code examples
ruby-on-railsrubyruby-on-rails-2

Undefined method `name' for "SystemTimer":String


I am having a problem getting an old Ruby on Rails 2 app that hasn't worked in a year to work.

I'm trying to run rake test:functionals in the root of my project directory, but am getting undefined method 'name' for "SystemTimer":String.

I've pasted everything that I believe relevant to the problem here: http://pastebin.com/NgBvystZ

Also, when I run rake itself, I get Errors running test:units! Not sure how to debug that.

I have copied and pasted everything that I think would be useful to understanding this problem. Your time is greatly appreciated. Thank you.


Solution

  • This is an incompatibility between versions of RubyGems greater than 1.3.7 and versions of Rails less than 2.3.12. There are a few ways to solve this.

    1. Use Bundler

      Bundler is easy to install, fixes this problem, and has a number of other advantages as well. I highly recommend it.

    2. Upgrade to Rails 2.3.12 or higher

      Rails 2.3.12 fixed compatibility issues with RubyGems 1.8.5 (see release report).

    3. Downgrade to RubyGems 1.3.7

      I would not recommended this unless you have no other choice. Use this command: gem update --system 1.3.7. Also, version 1.7.2 has partial compatibility (it will run, but freezing gems will fail and there are likely other issues).