ERROR: While executing gem … (Zlib::BufError)


Recently I was trying to update the rails gem (to rails 2.2 specifically). However, it threw an error everytime: ERROR: While executing gem … (Zlib::BufError).


I’ve figured that the solution is to
1. gem update –system
2. gem install update_rubygems
3. update_rubygems


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 ….or you could be on a different platform with the same issue.


Uninstall Rails (Currently 2.0.2 is the latest release)…so anythig > 2.0.2 should be removed.

1. 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)

2. Make sure the source is pointing to “” by running gem source. If it is pointing to “”, remove it by typing the following: sudo gem remove -r “”

3. Run: sudo gem install rails -v 2.0.2 to install the latest release version

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.