This project is archived and is in readonly mode.

#4268 ✓resolved
VirtualFunction

Bad reference to TZInfo in Rails 3.0.0 beta master

Reported by VirtualFunction | March 25th, 2010 @ 08:34 AM | in 3.0.2

I get this error:

ActionView::Template::Error (uninitialized constant ActiveSupport::TimeZone::TZInfo)

which happens in

~/.bundle/ruby/1.9.1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/values/time_zone.rb:309:in tzinfo'

Looking in the source

    # TODO: Preload instead of lazy load for thread safety
    def tzinfo
      require 'tzinfo' unless defined?(TZInfo)
      @tzinfo ||= TZInfo::Timezone.get(MAPPING[name])
    end

as a quick fix can be changed to:

    # TODO: Preload instead of lazy load for thread safety
    def tzinfo
      require 'tzinfo' unless defined?(::TZInfo)
      @tzinfo ||= ::TZInfo::Timezone.get(MAPPING[name])
    end

I guess though in the long term addressing the todo automatically fix this.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages