I am getting HTTP 500 Internal server error when updating info for one of page of my website. Please help me and for your reference i have posted ruby trace below: Processing ModelsController#update (for 203.187.233.94 at 2009-03-20 02:40:06) [PUT] Session ID: BAh7CDoMY3NyZl9pZCIlYTc0NDc5OWI1ZDNhMDM4YmVjZTY0YjE3NGZkODQ2 YjAiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh c2h7AAY6CkB1c2VkewA6DHVzZXJfaWRpBw==--0cc7b78313f817b2be3cc19a19164dbfa9a351e9 Parameters: {"commit"=>"Update", "action"=>"update", "_method"=>"put", "authenticity_token"=>"47bc4f13abf32c82e7602e1ebd52f5a5338a566d", "id"=>"12", "controller"=>"admin/models", "model"=>{"city"=>"Surat", "biography"=>"", "measurements"=>"", "weight"=>"110", "agency_rep_email"=>"", "agency_address"=>"", "country_id"=>"1", "approved"=>"0", "agency_name"=>"", "region_id"=>"1", "sex"=>"m", "agency_rep_name"=>"", "height"=>"5''3", "first_name"=>"Jignesh", "agency_phone"=>"", "eye_color_id"=>"3", "hair_color_id"=>"9", "age"=>"30", "last_name"=>"Wadia"}} NoMethodError (undefined method `call'' for nil:NilClass): /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:156:in `respond'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:154:in `each'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:154:in `respond'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:107:in `respond_to'' /app/controllers/admin/models_controller.rb:64:in `update'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/base.rb:1162:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/base.rb:1162:in `perform_action_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/filters.rb:580:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/filters.rb:573:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/rescue.rb:201:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/caching/sql_cache.rb:13:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/ active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/ active_record/query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/caching/sql_cache.rb:12:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/base.rb:529:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/base.rb:529:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/filters.rb:569:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/session_management.rb:130:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/base.rb:389:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:149:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:107:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:104:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:104:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:120:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:35:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 103:in `process_request'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 153:in `with_signal_handler'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 101:in `process_request'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 78:in `process_each_request'' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 77:in `process_each_request'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 76:in `catch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 76:in `process_each_request'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 50:in `process!'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: 24:in `process!'' dispatch.fcgi:24 Rendering /home/canadian/canadianmodelscouts.com/public/500.html (500 Internal Server Error) REgs, Jignesh Wadia --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
\"Wolas!\"
2009-Mar-20 10:35 UTC
Re: NoMethodError (undefined method `call'' for nil:NilClass):
it would be a good idea to post the controller method update and the class Model. On Mar 20, 9:45 am, Jigu <wadiaj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am getting HTTP 500 Internal server error when updating info for one > of page of my website. Please help me and for your reference i have > posted ruby trace below: > > Processing ModelsController#update (for 203.187.233.94 at 2009-03-20 > 02:40:06) [PUT] > Session ID: > BAh7CDoMY3NyZl9pZCIlYTc0NDc5OWI1ZDNhMDM4YmVjZTY0YjE3NGZkODQ2 > YjAiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh > c2h7AAY6CkB1c2VkewA6DHVzZXJfaWRpBw==--0cc7b78313f817b2be3cc19a19164dbfa9a351e9 > Parameters: {"commit"=>"Update", "action"=>"update", > "_method"=>"put", > "authenticity_token"=>"47bc4f13abf32c82e7602e1ebd52f5a5338a566d", > "id"=>"12", "controller"=>"admin/models", "model"=>{"city"=>"Surat", > "biography"=>"", "measurements"=>"", "weight"=>"110", > "agency_rep_email"=>"", "agency_address"=>"", "country_id"=>"1", > "approved"=>"0", "agency_name"=>"", "region_id"=>"1", "sex"=>"m", > "agency_rep_name"=>"", "height"=>"5''3", "first_name"=>"Jignesh", > "agency_phone"=>"", "eye_color_id"=>"3", "hair_color_id"=>"9", > "age"=>"30", "last_name"=>"Wadia"}} > > NoMethodError (undefined method `call'' for nil:NilClass): > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/mime_responds.rb:156:in `respond'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/mime_responds.rb:154:in `each'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/mime_responds.rb:154:in `respond'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/mime_responds.rb:107:in `respond_to'' > /app/controllers/admin/models_controller.rb:64:in `update'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:1162:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:1162:in `perform_action_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/filters.rb:580:in `call_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/filters.rb:573:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/rescue.rb:201:in `perform_action_without_caching'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/caching/sql_cache.rb:13:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/ > active_record/connection_adapters/abstract/query_cache.rb:33:in > `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/ > active_record/query_cache.rb:8:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/caching/sql_cache.rb:12:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:529:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:529:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/filters.rb:569:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/session_management.rb:130:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/base.rb:389:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:149:in `handle_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:107:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:104:in `synchronize'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:104:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:120:in `dispatch_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/ > action_controller/dispatcher.rb:35:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 103:in `process_request'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 153:in `with_signal_handler'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 101:in `process_request'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 78:in `process_each_request'' > /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in > `each_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in > `each_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 77:in `process_each_request'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 76:in `catch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 76:in `process_each_request'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 50:in `process!'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb: > 24:in `process!'' > dispatch.fcgi:24 > > Rendering /home/canadian/canadianmodelscouts.com/public/500.html (500 > Internal Server Error) > > REgs, > Jignesh Wadia--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jignesh Wadia
2009-Mar-20 12:00 UTC
Re: NoMethodError (undefined method `call'' for nil:NilClass):
"Wolas!" wrote:> it would be a good idea to post the controller method update and the > class Model.But how can I fix that error message? Database information is updating properly but page is redirecting to HTTP 500 Internal server error page and I am unable to fix this error. Please help me how can i fix it. I am using code below to be updating model entry... and same code works properly for other modules. # PUT /models/1 # PUT /models/1.xml def update @model = Model.find(params[:id], :include=>:user) respond_to do |format| if @model.update_attributes(params[:model]) @model.user.roles.clear @model.user.roles << Role.find_or_create_by_name("model") #flash[:notice] = "Model was successfully updated." #format.html { redirect_to([:admin, @model]) } #format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @model.errors, :status => :unprocessable_entity } end end end -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2009-Mar-20 14:11 UTC
Re: NoMethodError (undefined method `call'' for nil:NilClass):
On Mar 20, 12:00 pm, Jignesh Wadia <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> But how can I fix that error message? Database information is updating > properly but page is redirecting to HTTP 500 Internal server error page > and I am unable to fix this error. Please help me how can i fix it. I am > using code below to be updating model entry... and same code works > properly for other modules. > > # PUT /models/1 > # PUT /models/1.xml > def update > @model = Model.find(params[:id], :include=>:user) > > respond_to do |format| > if @model.update_attributes(params[:model]) > @model.user.roles.clear > @model.user.roles << Role.find_or_create_by_name("model") > #flash[:notice] = "Model was successfully updated." > #format.html { redirect_to([:admin, @model]) } > #format.xml { head :ok }in this branch you''re not telling rails what to do - you''ve commented out all your format.bla calls Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jignesh Wadia
2009-Mar-21 06:00 UTC
Re: NoMethodError (undefined method `call'' for nil:NilClass):
Frederick Cheung wrote:> On Mar 20, 12:00�pm, Jignesh Wadia <rails-mailing-l...@andreas-s.net> > wrote: >> >> � � respond_to do |format| >> � � � if @model.update_attributes(params[:model]) >> � � � � @model.user.roles.clear >> � @model.user.roles << Role.find_or_create_by_name("model") >> � � � � #flash[:notice] = "Model was successfully updated." >> � � � � #format.html { redirect_to([:admin, @model]) } >> � � � � #format.xml �{ head :ok } > > in this branch you''re not telling rails what to do - you''ve commented > out all your format.bla calls > > FredOkay now I have activated commented statements but still I am getting same error message ane redirecting to 505 error page. Jignesh Wadia -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---