Happily coding away in a Rails 2.2.2 Bort based-app, when I suddenly start getting this error after a few requests: NoMethodError (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.include?): /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:142:in `create_time_zone_conversion_attribute?'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:75:in `define_attribute_methods'' This only appears if I authenticate to the application. I can make a couple of requests, then i start getting the above error. While I don''t think I''ve made any changes to cause something like this, when you''re so far removed from the low-level bits of the framework, it''s hard to tell. I''ve searched the net, and while I''ve found a few hits on this, there are no solutions to be found. Anyone have any suggestions? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
sadeesh kumar viswanathan
2008-Dec-19 19:36 UTC
Re: nil object in create_time_zone_conversion_attribute?
Paste you full error trace here. Thanks, Sadeesh. On Dec 19, 9:23 pm, KenM <Anda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Happily coding away in a Rails 2.2.2 Bort based-app, when I suddenly > start getting this error after a few requests: > > NoMethodError (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.include?): > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:142:in > `create_time_zone_conversion_attribute?'' > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:75:in `define_attribute_methods'' > > This only appears if I authenticate to the application. I can make a > couple of requests, then i start getting the above error. While I > don''t think I''ve made any changes to cause something like this, when > you''re so far removed from the low-level bits of the framework, it''s > hard to tell. > > I''ve searched the net, and while I''ve found a few hits on this, there > are no solutions to be found. > > Anyone have any suggestions?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Full trace below... This issue is not machine specific, as I get the same error on my laptop. Both systems are up to date with respect to gems.... NoMethodError (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.include?): /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:142:in `create_time_zone_conversion_attribute?'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:75:in `define_attribute_methods'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:71:in `each'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:71:in `define_attribute_methods'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/attribute_methods.rb:242:in `method_missing'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ active_record/base.rb:2662:in `hash'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:150:in `clear'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:150:in `reload_application'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:178:in `send'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:178:in `evaluate_method'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:166:in `call'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:90:in `run'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:90:in `each'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:90:in `send'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:90:in `run'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/callbacks.rb:277:in `run_callbacks'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:109:in `dispatch_unlocked'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:123:in `dispatch'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:122:in `synchronize'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:122:in `dispatch'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:132:in `dispatch_cgi'' /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_controller/dispatcher.rb:39:in `dispatch'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:76:in `process'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:74:in `synchronize'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ rails.rb:74:in `process'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 159:in `process_client'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 158:in `each'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 158:in `process_client'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 285:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 285:in `initialize'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 285:in `new'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 285:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 268:in `initialize'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 268:in `new'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: 268:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:282:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:in `each'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 128:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ command.rb:212:in `run'' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: 281 /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:142:in `load_without_new_constant_marking'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:142:in `load'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:521:in `new_constants_in'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:142:in `load'' /opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/ mongrel.rb:64 /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:521:in `new_constants_in'' /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/dependencies.rb:153:in `require'' /opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/ server.rb:49 /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' script/server:3 On Dec 19, 12:36 pm, sadeesh kumar viswanathan <sadath...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Paste you full error trace here. > > Thanks, > Sadeesh. > > On Dec 19, 9:23 pm, KenM <Anda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Happily coding away in a Rails 2.2.2 Bort based-app, when I suddenly > > start getting this error after a few requests: > > > NoMethodError (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.include?): > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > > active_record/attribute_methods.rb:142:in > > `create_time_zone_conversion_attribute?'' > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > > active_record/attribute_methods.rb:75:in `define_attribute_methods'' > > > This only appears if I authenticate to the application. I can make a > > couple of requests, then i start getting the above error. While I > > don''t think I''ve made any changes to cause something like this, when > > you''re so far removed from the low-level bits of the framework, it''s > > hard to tell. > > > I''ve searched the net, and while I''ve found a few hits on this, there > > are no solutions to be found. > > > Anyone have any suggestions?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Some further information.... This issue is apparently caused by not passing enough parameters to the route helpers when you have nested resources. For example, I have a gallery, which has a nested image resource. When generating links in the view, I called the helper, but I didn''t pass an array with both the gallery and the image, only the image. The first time presenting the view would work; the second, I would get the stack trace, and from that point on the mongrel instance is hooped, and would not serve any content. It would have to be restarted. I''ve fixed the view, and the problem is now resolved. However, I''m concerned about being able to crash mongrel hard this way..... On Dec 19, 1:47 pm, KenM <Anda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Full trace below... > > This issue is not machine specific, as I get the same error on my > laptop. Both systems are up to date with respect to gems.... > > NoMethodError (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.include?): > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:142:in > `create_time_zone_conversion_attribute?'' > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:75:in `define_attribute_methods'' > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:71:in `each'' > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:71:in `define_attribute_methods'' > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/attribute_methods.rb:242:in `method_missing'' > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > active_record/base.rb:2662:in `hash'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:150:in `clear'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:150:in `reload_application'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:178:in `send'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:178:in `evaluate_method'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:166:in `call'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:90:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:90:in `each'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:90:in `send'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:90:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/callbacks.rb:277:in `run_callbacks'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:109:in `dispatch_unlocked'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:123:in `dispatch'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:122:in `synchronize'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:122:in `dispatch'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:132:in `dispatch_cgi'' > /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ > action_controller/dispatcher.rb:39:in `dispatch'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > rails.rb:76:in `process'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > rails.rb:74:in `synchronize'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ > rails.rb:74:in `process'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 159:in `process_client'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 158:in `each'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 158:in `process_client'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 285:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 285:in `initialize'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 285:in `new'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 285:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 268:in `initialize'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 268:in `new'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb: > 268:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ > configurator.rb:282:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ > configurator.rb:281:in `each'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ > configurator.rb:281:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: > 128:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ > command.rb:212:in `run'' > /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails: > 281 > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:142:in > `load_without_new_constant_marking'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:142:in `load'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:521:in `new_constants_in'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:142:in `load'' > /opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/ > mongrel.rb:64 > /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:153:in `require'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:521:in `new_constants_in'' > /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:153:in `require'' > /opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/ > server.rb:49 > /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > script/server:3 > > On Dec 19, 12:36 pm, sadeesh kumar viswanathan <sadath...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > Paste you full error trace here. > > > Thanks, > > Sadeesh. > > > On Dec 19, 9:23 pm, KenM <Anda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Happily coding away in a Rails 2.2.2 Bort based-app, when I suddenly > > > start getting this error after a few requests: > > > > NoMethodError (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.include?): > > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > > > active_record/attribute_methods.rb:142:in > > > `create_time_zone_conversion_attribute?'' > > > /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/ > > > active_record/attribute_methods.rb:75:in `define_attribute_methods'' > > > > This only appears if I authenticate to the application. I can make a > > > couple of requests, then i start getting the above error. While I > > > don''t think I''ve made any changes to cause something like this, when > > > you''re so far removed from the low-level bits of the framework, it''s > > > hard to tell. > > > > I''ve searched the net, and while I''ve found a few hits on this, there > > > are no solutions to be found. > > > > Anyone have any suggestions?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeffrey L. Taylor
2008-Dec-20 05:53 UTC
Re: nil object in create_time_zone_conversion_attribute?
Quoting KenM <Andawyr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Some further information.... > > This issue is apparently caused by not passing enough parameters to > the route helpers when you have nested resources. For example, I have > a gallery, which has a nested image resource. When generating links > in the view, I called the helper, but I didn''t pass an array with both > the gallery and the image, only the image. > > The first time presenting the view would work; the second, I would get > the stack trace, and from that point on the mongrel instance is > hooped, and would not serve any content. It would have to be > restarted. > > I''ve fixed the view, and the problem is now resolved. > > However, I''m concerned about being able to crash mongrel hard this > way..... >I was getting similar errors I started using Rails.cache w/ Rails 2.2.2. I''m using Webrick, not Mongrel. I gave up and went back to using my homegrown caching. With you information about not enough parameters, I may go back and try again. Jeffrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeffrey L. Taylor
2008-Dec-20 18:26 UTC
Re: nil object in create_time_zone_conversion_attribute?
Quoting Jeffrey L. Taylor <ror-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org>:> > Quoting KenM <Andawyr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > Some further information.... > > > > This issue is apparently caused by not passing enough parameters to > > the route helpers when you have nested resources. For example, I have > > a gallery, which has a nested image resource. When generating links > > in the view, I called the helper, but I didn''t pass an array with both > > the gallery and the image, only the image. > > > > The first time presenting the view would work; the second, I would get > > the stack trace, and from that point on the mongrel instance is > > hooped, and would not serve any content. It would have to be > > restarted. > > > > I''ve fixed the view, and the problem is now resolved. > > > > However, I''m concerned about being able to crash mongrel hard this > > way..... > > > > I was getting similar errors I started using Rails.cache w/ Rails 2.2.2. I''m > using Webrick, not Mongrel. I gave up and went back to using my homegrown > caching. With you information about not enough parameters, I may go back and > try again. >I went back and looked hard at my code that was crashing. I was missing a parameter to a yield statement. So Rails appears to be brittle around this issue. And maybe Mongrel more brittle than Webrick. Thanks for the hint. It is always nice to get rid of code that I have to maintain in favor of builtin stuff that someone else maintains. Jeffrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I just ran into this problem in an action that had nothing to do with a view (the action was just rendering a status code). Any chance you are assigning an AR class to a variable, and then calling methods on that variable like so: saved_class = User # User is AR saved_class.create(whatever) When I changed that to this: saved_class = :User Object.const_get(saved_class).create(whatever) everyone was happy. I''ve love to track down why this is happening in my case -- but no time. Plus, that''s the way thoughtbot does it in factory_girl, so it''s gotta be right :-) Good luck. On Dec 20, 1:26 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting Jeffrey L. Taylor <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org>: > > > > > > > Quoting KenM <Anda...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > Some further information.... > > > > This issue is apparently caused by not passing enough parameters to > > > the route helpers when you have nested resources. For example, I have > > > a gallery, which has a nested image resource. When generating links > > > in the view, I called the helper, but I didn''t pass an array with both > > > the gallery and the image, only the image. > > > > The first time presenting the view would work; the second, I would get > > > the stack trace, and from that point on the mongrel instance is > > > hooped, and would not serve any content. It would have to be > > > restarted. > > > > I''ve fixed the view, and the problem is now resolved. > > > > However, I''m concerned about being able to crash mongrel hard this > > > way..... > > > I was getting similar errors I started using Rails.cache w/ Rails 2.2.2. I''m > > using Webrick, not Mongrel. I gave up and went back to using my homegrown > > caching. With you information about not enough parameters, I may go back and > > try again. > > I went back and looked hard at my code that was crashing. I was missing a > parameter to a yield statement. So Rails appears to be brittle around this > issue. And maybe Mongrel more brittle than Webrick. > > Thanks for the hint. It is always nice to get rid of code that I have to > maintain in favor of builtin stuff that someone else maintains. > > Jeffrey--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Robert Matei
2009-Jan-03 03:47 UTC
Re: nil object in create_time_zone_conversion_attribute?
I''m getting the same error and a bit baffled. For me it''s happening when I''ve cached an array of ActiveRecord objects with Rails.cache and try to read them back. If I''m dealing with an array of integers it works fine. Note that this is only happening on my development machine with whatever Rails'' default caching mechanism is. In production, with Memcached, it''s fine, so I just ended up installing Memcached on my development machine and it worked fine. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Luebcke
2009-Feb-07 19:43 UTC
Re: nil object in create_time_zone_conversion_attribute?
Robert Matei wrote:> I''m getting the same error and a bit baffled. > > For me it''s happening when I''ve cached an array of ActiveRecord objects > with Rails.cache and try to read them back. If I''m dealing with an array > of integers it works fine. > > Note that this is only happening on my development machine with whatever > Rails'' default caching mechanism is. In production, with Memcached, it''s > fine, so I just ended up installing Memcached on my development machine > and it worked fine.That was exactly my experience, except that I''m a bit of a n00b with RoR (though not other development) and figured I must be doing something wrong. Hours and hours later I finally realized that, no, Rails.cache in 2.2.2 (at least) is failing to either store or retrieve ActiveRecord objects. Five minutes after reading this I had memcached installed locally and all my problems were solved. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Luebcke wrote:> Robert Matei wrote: >> I''m getting the same error and a bit baffled. >> >> For me it''s happening when I''ve cached an array of ActiveRecord objects >> with Rails.cache and try to read them back. If I''m dealing with an array >> of integers it works fine. >> >> Note that this is only happening on my development machine with whatever >> Rails'' default caching mechanism is. In production, with Memcached, it''s >> fine, so I just ended up installing Memcached on my development machine >> and it worked fine. > > That was exactly my experience, except that I''m a bit of a n00b with RoR > (though not other development) and figured I must be doing something > wrong. Hours and hours later I finally realized that, no, Rails.cache in > 2.2.2 (at least) is failing to either store or retrieve ActiveRecord > objects. > > Five minutes after reading this I had memcached installed locally and > all my problems were solved.I had the same problem, and same solution. But I just recently upgraded to 2.3.2 and everything seems to work fine. I suppose whatever it was got fixed? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Madrid
2009-Apr-28 09:47 UTC
Re: nil object in create_time_zone_conversion_attribute?
Joe Ellis wrote:> Chris Luebcke wrote: >> Robert Matei wrote: >>> I''m getting the same error and a bit baffled. >>> >>> For me it''s happening when I''ve cached an array of ActiveRecord objects >>> with Rails.cache and try to read them back. If I''m dealing with an array >>> of integers it works fine. >>> >>> Note that this is only happening on my development machine with whatever >>> Rails'' default caching mechanism is. In production, with Memcached, it''s >>> fine, so I just ended up installing Memcached on my development machine >>> and it worked fine. >> >> That was exactly my experience, except that I''m a bit of a n00b with RoR >> (though not other development) and figured I must be doing something >> wrong. Hours and hours later I finally realized that, no, Rails.cache in >> 2.2.2 (at least) is failing to either store or retrieve ActiveRecord >> objects. >> >> Five minutes after reading this I had memcached installed locally and >> all my problems were solved. > > I had the same problem, and same solution. But I just recently upgraded > to 2.3.2 and everything seems to work fine. I suppose whatever it was > got fixed?I just upgraded to 2.3.2 on Windows 7 and am getting the error. Using file system gives a different error Unable to create directory, and memcached won''t install. Not sure what to do. -- Posted via http://www.ruby-forum.com/.
Michael Madrid wrote:> I just upgraded to 2.3.2 on Windows 7 and am getting the error. Using > file system gives a different error Unable to create directory, and > memcached won''t install. Not sure what to do.I''ve seen this problem in 2.3.2 and now in 2.3.3. The above mentioned solution does not resolve this issue for me. -- Posted via http://www.ruby-forum.com/.
bill walton
2009-Jul-21 02:40 UTC
Re: nil object in create_time_zone_conversion_attribute?
Hi Guys, On Tue, 2009-07-21 at 02:06 +0200, Evan Light wrote:> Michael Madrid wrote: > > I just upgraded to 2.3.2 on Windows 7 and am getting the error. Using > > file system gives a different error Unable to create directory, and > > memcached won''t install. Not sure what to do. > > I''ve seen this problem in 2.3.2 and now in 2.3.3. The above mentioned > solution does not resolve this issue for me.Either of you filed a bug report? With a sandbox app and tests? Best regards, Bill