Forum: Ruby on Rails require tzinfo on rails 1.2

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5a992f256f765f8ee3dbb2af9d3db4e0?d=identicon&s=25 Robbie Shepherd (robbie)
on 2007-02-28 09:19
I've just upgraded rails to 1.2 and now everything breaks when accessing
pages that use tzinfo.

I get the following errors:

uninitialized constant FriendController::Timezone
#{RAILS_ROOT}/app/controllers/friend_controller.rb:22:in `index'

Can someone please tell me how to "require" tzinfo so it can be used in
any of my controllers?
153868096910b6bca47e2a9212c2df56?d=identicon&s=25 Frederick Cheung (fcheung)
on 2007-03-01 16:54
Could this be something to do with this:

We’ve fixed a bug that allowed libraries from Ruby’s standard library to
be auto-loaded on reference. Before, if you merely reference the
Pathname constant, we’d autoload pathname.rb. No more, you’ll need to
manually require 'pathname' now.


If so you'll have to stick require 'tzinfo' at the top of files that use

821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2007-03-01 16:56
(Received via mailing list)
> Can someone please tell me how to "require" tzinfo so it can be used in
> any of my controllers?

require 'tzinfo' in your config/environment.rb file.

Rick Olson
5a992f256f765f8ee3dbb2af9d3db4e0?d=identicon&s=25 Robbie Shepherd (robbie)
on 2007-03-02 08:35
thanks. to get it working I had to:
#at the top of config/environment.rb
require 'tzinfo'


#at the top of my controller
include TZInfo

Now if only I can get the search_generator working simply
refuses to load the Search module. IF anyones got a solution or willing
to help I'd be happy to throw a few $$ at them for their time.
This topic is locked and can not be replied to.