[TZInfo-users] "can't modify frozen object"

Siva Jagadeesan siva at yewoh.com
Wed Jan 23 15:43:53 EST 2008


Thanks Phil for replying.

We are using  tzinfo_timezone plugin for changing dates before  
displaying or storing it the database.


This is the exception stack trace

A ActionView::TemplateError occurred in groups#load_app:

can't modify frozen object
On line #7 of app/views/groups/_groups_smslist.haml

   4:       - c = 0
   5:       - for post in recent_posts
   6:         %div{:class=>'smslist_' + (c % 2).to_s}
   7:           = post.text +  ' by ' + b(post.author.login) + ' on '  
+ b(post.channel.name) + i(' (' + post.created_at.to_human_label + ')')
   8:         - c = c+1
   9:   - else
   10:     %i There are no posts yet!
   #{RAILS_ROOT}/app/views/groups/_groups_smslist.haml:7
   #{RAILS_ROOT}/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb: 
215:in `tzinfo'
   #{RAILS_ROOT}/vendor/plugins/tzinfo_timezone/lib/tzinfo_timezone.rb: 
189:in `utc_to_local'
   #{RAILS_ROOT}/vendor/plugins/tztime/lib/tz_time_helpers/ 
active_record_methods.rb:16:in `created_at'
   (eval):22:in `_render_haml_11'
   (eval):18:in `each'
   (eval):18:in `_render_haml_11'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:431:in `send'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:431:in `compile'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:183:in `to_html'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:69:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
416:in `delegate_render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
299:in `render_template_old'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:96:in  
`render_template'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
260:in `render_file'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
275:in `render_without_haml'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ 
action_view_mods.rb:17:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
59:in `render_partial'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:30:in `benchmark'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
58:in `render_partial'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
287:in `render_without_haml'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ 
action_view_mods.rb:17:in `render'
   (eval):11:in `_render_haml_35'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:431:in `send'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:431:in `compile'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:183:in `to_html'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:69:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
416:in `delegate_render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
299:in `render_template_old'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:96:in  
`render_template'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
260:in `render_file'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
275:in `render_without_haml'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ 
action_view_mods.rb:17:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
59:in `render_partial'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:30:in `benchmark'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
58:in `render_partial'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
287:in `render_without_haml'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ 
action_view_mods.rb:17:in `render'
   (eval):24:in `_render_haml_32'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:431:in `send'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:431:in `compile'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/engine.rb:183:in `to_html'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:69:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
416:in `delegate_render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
299:in `render_template_old'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/template.rb:96:in  
`render_template'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
260:in `render_file'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
275:in `render_without_haml'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ 
action_view_mods.rb:17:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
59:in `render_partial'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:30:in `benchmark'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/partials.rb: 
58:in `render_partial'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb: 
287:in `render_without_haml'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/haml/helpers/ 
action_view_mods.rb:17:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/ 
prototype_helper.rb:597:in `render'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/ 
prototype_helper.rb:459:in `replace_html'
   #{RAILS_ROOT}/app/controllers/application.rb:90:in  
`render_application'
   #{RAILS_ROOT}/app/controllers/application.rb:17:in  
`__bind_1201115799_598358'
   #{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/ 
core_ext/object/extending.rb:44:in `[]'
   #{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/ 
core_ext/object/extending.rb:44:in `instance_exec'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/ 
prototype_helper.rb:313:in `initialize'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
769:in `new'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
769:in `render_with_no_layout'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
layout.rb:256:in `render_without_benchmark'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:50:in `render'
   /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:50:in `render'
   #{RAILS_ROOT}/app/controllers/application.rb:16:in `load_app'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
1095:in `send'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
1095:in `perform_action_without_filters'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:632:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:638:in `call_filter'
   #{RAILS_ROOT}/app/controllers/application.rb:111:in `set_timezone'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:456:in `send'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:456:in `call'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:637:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:638:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:438:in `call'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:637:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:638:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:438:in `call'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:637:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:638:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:449:in `call'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:637:in `call_filter'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:619:in `perform_action_without_benchmark'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:66:in `perform_action_without_rescue'
   /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
benchmarking.rb:66:in `perform_action_without_rescue'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
rescue.rb:83:in `perform_action'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
430:in `send'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
430:in `process_without_filters'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
filters.rb:624:in `process_without_session_management_support'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/ 
session_management.rb:114:in `sass_old_process'
   #{RAILS_ROOT}/vendor/plugins/haml/lib/sass/plugin.rb:124:in `process'
   #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb: 
330:in `process'
   #{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:in  
`dispatch'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/rails.rb: 
76:in `process'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/rails.rb: 
74:in `synchronize'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/rails.rb: 
74:in `process'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:159:in  
`process_client'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:158:in  
`each'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:158:in  
`process_client'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in `run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in  
`initialize'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in `new'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:285:in `run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:268:in  
`initialize'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:268:in `new'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel.rb:268:in `run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/ 
configurator.rb:282:in `run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/ 
configurator.rb:281:in `each'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/ 
configurator.rb:281:in `run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:128:in  
`run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/lib/mongrel/command.rb: 
212:in `run'
   /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.3/bin/mongrel_rails:281
   /usr/bin/mongrel_rails:16:in `load'
   /usr/bin/mongrel_rails:16

The exception is happening in that plugin. I am not sure what is  
happening. Has anybody else have come across this problem?

Rgds,

--Siva Jagadeesan

On Jan 23, 2008, at 2:21 PM, Philip Ross wrote:

> On 23/01/2008, Siva Jagadeesan <siva at yewoh.com> wrote:
>> Hi all
>>
>> At yewoh.com , we keep randomly getting "can't modify frozen  
>> object" error.
>>
>> Any idea?
>
> Hi Siva,
>
> It's a bit difficult to work out what is going on from just that error
> message alone. It may not be anything to do with TZInfo. If you've got
> a stack trace for the error in your logs, it should tell you what is
> causing the problems.
>
> TZInfo does use the freeze method to protect some of the arrays that
> are returned. If you are accessing these methods and then attempting
> to modify the results, then this may be the cause of the problem.
>
> Regards,
>
> Phil
>
> -- 
> Phil Ross
> http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby
> _______________________________________________
> TZInfo-users mailing list
> TZInfo-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/tzinfo-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/tzinfo-users/attachments/20080123/359c80ba/attachment-0001.html 


More information about the TZInfo-users mailing list