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!

7 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Twitter

Great web stats at @petrescue , the driving force behind the rebuild of their systems by @frontiergroup . http://t.co/MTvfoxnU

@frontiergroup about 3 weeks ago #

Search Posts

Featured Posts

Categories

Archives

View more archives