GeorgeL
2013-Sep-27 10:06 UTC
Why am I getting nil errors in create_time_zone_conversion_attribute? How to fix?
Why am I getting nil errors in "create_time_zone_conversion_attribute?" Where do I start in trying to determine how to diagnose and debug this issue? I have been looking at it for a couple of days now and I am pretty stuck. What should one be looking for in order to track this down? /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods/time_zone_conversion.rb:56:in `create_time_zone_conversion_attribute?'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods/time_zone_conversion.rb:35:in `define_method_attribute='' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:287:in `block in define_attribute_method'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:280:in `each'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:280:in `define_attribute_method'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:246:in `block in define_attribute_methods'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:246:in `each'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:246:in `define_attribute_methods'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:29:in `block in define_attribute_methods'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:26:in `synchronize'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:26:in `define_attribute_methods'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:167:in `respond_to?'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_assignment.rb:44:in `rescue in _assign_attribute'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_assignment.rb:42:in `_assign_attribute'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_assignment.rb:29:in `block in assign_attributes'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_assignment.rb:23:in `each'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_assignment.rb:23:in `assign_attributes'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/core.rb:192:in `initialize'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:27:in `new'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:27:in `new'' /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/reflection.rb:189:in `build_association'' .... Completed 500 Internal Server Error in 2939ms NoMethodError (undefined method `save'' for nil:NilClass): app/controllers/registrations_controller.rb:45:in `block (2 levels) in create'' app/controllers/registrations_controller.rb:8:in `create'' Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cbbc5b0b-e33a-425c-805e-5fc487971548%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2013-Sep-29 08:26 UTC
Re: Why am I getting nil errors in create_time_zone_conversion_attribute? How to fix?
On 27 September 2013 11:06, GeorgeL <fuzzydolphin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why am I getting nil errors in "create_time_zone_conversion_attribute?" > > Where do I start in trying to determine how to diagnose and debug this > issue? I have been looking at it for a couple of days now and I am pretty > stuck. What should one be looking for in order to track this down? > > > /Users/myself/.rvm/gems/ruby-2.0.0-p247@rails4/gems/activerecord-4.0.0/lib/active_record/attribute_methods/time_zone_conversion.rb:56:in > `create_time_zone_conversion_attribute?''> [snip]> NoMethodError (undefined method `save'' for nil:NilClass): > app/controllers/registrations_controller.rb:45:in `block (2 levels) in > create''I would start by looking at that line of code and working out why you are trying to save something that is nil. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvcib8HkZp0ksiKVcB2F-zLbaZpfg9n1EF_5MX8bnP3Nw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.