Problems with DateTime, TimeZone, Bundler and Rails 2.3.5
Posted in Inside TFG
I’ve been converting a Rails 2.3.5 project to using Bundler and ran into a bit of a snag this week. I was getting a over 300 failing tests with errors such as :
uninitialized constant ActiveSupport::TimeWithZone
and
no such file to load -- tzinfo
I couldn’t find anything that I’d missed, I’d moved all my gem declarations from the various environment files into my Gemfile and hadn’t had many issues (many) but this was a really odd problem. It was as if part of Rails wasn’t being loaded correctly.
It turns out that you need to include a tzinfo gem for some reason. Don’t ask me how I ran across the solution for this issue, I really can’t remember. It works though.
So if you’re having issues with your app, or tests not passing due to time zone issues in Rails 2.3.x using Bundler then just include :
gem "tzinfo"
In your Gemfile, run another bundle install and away you go. It worked for me, I hope it works for you!
Pingback: Tweets that mention Problems with DateTime, TimeZone, Bundler and Rails 2.3.5 ยป Transcending Frontiers -- Topsy.com
Brice Bentler
Apr 27, 2010
Hi..I am reading your page for a few days now is there any way to subscribe by email
fitzy
Apr 29, 2010
Hi Brice,
You can subscribe to our newsletter, or subscribe in a feed reader to the RSS feed for the blog.
Edward
May 26, 2010
Thanks! Remember to require ‘tzinfo’ in your project’s initializers if you keep getting the uninitialized constant ActiveSupport::TimeWithZone error.
Sekhar Chakka
Jan 20, 2011
Thanks for the help. The solution worked for me.
Bernie
Apr 12, 2011
Just fixed an app with this post. Thanks for sharing!
Tio Computer
Dec 8, 2011
thanks for sharing.
you saved my life :)
it works for me