Nick Karnik
Nick Karnik
Author

Computer Scientist | Hacker | Entrepreneur | Ex-Microsoft | YC

Share


Twitter


undefined method `time_zone=' for # (NoMethodError)

I faced this error on OS X – Leopard when I updated my gems and created a new rails project. The problem is that Leopard ships with gem pointing to http://gems.rubyonrails.org, or you could be on a different platform with the same issue.

Nick KarnikNick Karnik

The solution is to uninstall Rails (Currently 2.0.2 is the latest release), so anything > 2.0.2 should be removed.

Remove all versions > 2.0.2 (or latest release) of rails (or all other versions if you don’t use them)

sudo gem uninstall rails

Make sure the source is pointing to “http://gems.rubyforge.org/” by running gem source. If it is pointing to “http://gems.rubyonrails.org”, remove it by typing the following:

sudo gem remove -r “http://gems.rubyonrails.org”

To install the latest release version run:

sudo gem install rails -v 2.0.2

Remember to recreate your rails project for any new projects as they create files that cause problems. For older projects, just making sure the right version is installed should work.