I’ve set up my app exactly in line with the Railscasts Time Zone Episode 1 but when I run
<%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones %>
I get this error
NoMethodError in Users#new
Showing app/views/users/new.html.erb
where line #27 raised:You have a nil object when you didn’t
expect it! You might have expected an
instance of Array. The error occurred
while evaluating nil.<=>
With line 27 being the aforementioned line. I am really stuck on this…
I have exactly the same problem. It seems to be related to Rails 2.3.8, because if I revert back to my previous version (2.3.4, by setting this in the /config/environment.rb), everything works fine. Looks like a bug. I’m checking out whether this bug report and resulting patch will solve this issue: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4942-activesupporttimezone-incorrectly-stores-bogus-values-in-zones_map#ticket-4942 .