Hassan Schroeder
2007-Jul-20 17:35 UTC
Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
New to rails, trying to do a pretty vanilla test-run app. Here''s the beginning of a log dump from the subject error (with a little formatting for readability): Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] Session ID: 41bc1e6351c24a63c12f97354da28e08 Parameters: {"commit"=>"Create", "action"=>"create", "controller"=>"person", "person"=>{"first_name"=>"Fred", "last_name"=>"Flintstone", "email"=>"fred-kOmEMmCHPphBDgjK7y7TUQ@public.gmane.org"}} Neither this nor the rest of the log is telling me much :-) How do you go about troubleshooting something like this? TIA! /* ruby 1.8.6 + rails 1.2.3 on SuSE Linux if that matters...*/ -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
John R
2007-Jul-20 18:04 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
Nothing there says anything about any error. What does the rest of the dump say? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2007-Jul-20 18:26 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
On 7/20/07, John R <robitaillejp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Nothing there says anything about any error. What does the rest of the > dump say?OK, here''s the entire log sequence: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] Session ID: 41bc1e6351c24a63c12f97354da28e08 Parameters: {"commit"=>"Create", "action"=>"create", "controller"=>"person", "person"=>{"first_name"=>"Fred", "last_name"=>"Flintstone", "email"=>"fred-kOmEMmCHPphBDgjK7y7TUQ@public.gmane.org"}} ArgumentError (wrong number of arguments (1 for 0)): /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/scaffolding.rb:128:in `initialize'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/scaffolding.rb:128:in `new'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/scaffolding.rb:128:in `create'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in `send'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in `perform_action_without_filters'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in `call_filter'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in `call_filter'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in `call'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in `call_filter'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in `perform_action_without_benchmark'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'' /usr/local/ruby-1.8.6/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in `perform_action'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in `send'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in `process_without_filters'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in `process_without_session_management_support'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in `process'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in `process'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in `handle_dispatch'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in `service'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/ruby-1.8.6/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in `dispatch'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59 /usr/local/ruby-1.8.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/ruby-1.8.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'' /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 /usr/local/ruby-1.8.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/ruby-1.8.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 Rendering /usr/local/ruby-1.8.6/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/templates/rescues/layout.rhtml (500 Internal Error) /* and apologies for the unintended pasted content in the subject! */ -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Adam Cohen
2007-Jul-20 19:42 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
what''s the code in your create action? Adam On 7/20/07, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > New to rails, trying to do a pretty vanilla test-run app. > > Here''s the beginning of a log dump from the subject error (with a > little formatting for readability): > > Processing PersonController#create (for 192.168.1.50 at 2007-07-20 > 10:19:55) [POST] > Session ID: 41bc1e6351c24a63c12f97354da28e08 > Parameters: {"commit"=>"Create", > "action"=>"create", > "controller"=>"person", > "person"=>{"first_name"=>"Fred", > "last_name"=>"Flintstone", > "email"=>"fred-kOmEMmCHPphBDgjK7y7TUQ@public.gmane.org"}} > > Neither this nor the rest of the log is telling me much :-) > > How do you go about troubleshooting something like this? > > TIA! > > /* ruby 1.8.6 + rails 1.2.3 on SuSE Linux if that matters...*/ > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2007-Jul-20 19:56 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
On 7/20/07, Adam Cohen <bionicboogie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > what''s the code in your create action?Perhaps I''m confused by the tutorial I''m reading, but I thought this was a built-in function delivered by ''scaffold''. /person/list works fine if I''ve manually entered person data in to the DB, as does /person/destroy, but the default create action fails. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Adam Cohen
2007-Jul-20 20:10 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
yeah the default scaffolding actions should work. I was trying to figure out if you added any custom methods to your create method.. Since it looks like somewhere along the line, a method is being called with a parameter, where it shouldn''t have one. What''s the address of the tutorial you''re following? Adam On 7/20/07, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 7/20/07, Adam Cohen <bionicboogie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > what''s the code in your create action? > > Perhaps I''m confused by the tutorial I''m reading, but I thought this > was a built-in function delivered by ''scaffold''. > > /person/list works fine if I''ve manually entered person data in to the > DB, as does /person/destroy, but the default create action fails. > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2007-Jul-20 22:35 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
On 7/20/07, Adam Cohen <bionicboogie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > yeah the default scaffolding actions should work. I was trying to > figure out if you added any custom methods to your create method.. > Since it looks like somewhere along the line, a method is being called > with a parameter, where it shouldn''t have one. What''s the address of > the tutorial you''re following?<http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=3> Note: I''m not following it exactly, more mapping it to my own little trial app :-) But the default `/person/new` page appears as it should, it''s just the operation fails on submit. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2007-Jul-21 17:16 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
A little more info, and I''m more puzzled than ever :-) Going back to step one in the tutorial , I realized I''d totally skipped the ''gem install mysql'' instruction. Unfortunately, that fails miserably, but that''s for a separate post. However, the USD64K question is: how can my rudimentary app read and update the DB without the driver, and then fail on trying to create a new entry? ??? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
John R
2007-Jul-21 20:30 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
Well, that ''gem intall mysql'' doesn''t install a driver, rather native bindings for ruby. It''s totally an optional step, but it generally speeds up db access. That ArgumentError is strange. I tried to do a few noobish things myself and couldn''t replicate it. Have you written some of your own actions in the PersonController? If so, can we see the code for your PersonController? Also, I assume that you''re doing the scaffolding by including the line ''scaffold :person'' in the controller. Have you tried scaffolding the other way? Try running the command ''script/generate scaffold yourController yourModel''. Note: That''ll blow away your controller, so back it up if there''s anything you might want later. J> However, the USD64K question is: how can my rudimentary app read > and update the DB without the driver, and then fail on trying to create > a new entry?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2007-Jul-22 15:03 UTC
Re: Processing PersonController#create (for 192.168.1.50 at 2007-07-20 10:19:55) [POST] ArgumentError in PersonController#create : wrong number of arguments (1 for 0)
On 7/21/07, John R <robitaillejp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well, that ''gem intall mysql'' doesn''t install a driver, rather native > bindings for ruby. It''s totally an optional stepThanks for clarifying that! So I can ignore that issue for now.> That ArgumentError is strange. I tried to do a few noobish things > myself and couldn''t replicate it. Have you written some of your own > actions in the PersonController?I had, but removing them didn''t change anything.> Also, I assume that you''re doing the scaffolding by including the line > ''scaffold :person'' in the controller. Have you tried scaffolding the > other way? Try running the command ''script/generate scaffold > yourController yourModel''.I tried this on a fresh new Rails instance and noticed that the controller created for Person was ''people_controller'', /not/ ''person_controller''. Maybe some conflict there? In any case, it works fine now using the second scaffold method, so let me wade back in and see what else I can break :-) At least I discovered Logger through this, but I''d be interested in any pointers to general RoR troubleshooting tips/tricks/best practice. Regardless, thanks for the help! -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---