I''m working with my first Rails application now. I''ve put some scaffold code in place and setup a few models with relationships, but that''s all at this point. When I tried to reach the list method in the only controller I''ve built I get a "Not Found" page. Looking in the log I see: # Logfile created on Thu Mar 24 11:02:13 CST 2005 by logger.rb/1.5.2.4 Processing ContactsController#list (for 127.0.0.1 at Thu Mar 24 11:02:56 CST 2005) Parameters: {"action"=>"list", "controller"=>"contacts"} [4;33mContact Load (0.000515) [1;37mSELECT * FROM contacts Rendering contacts/list within layouts/contacts [4;35mContact Columns (0.000505) [0;37mSHOW FIELDS FROM contacts Rendering layouts/contacts (200 OK) Completed in 0.035439 (28 reqs/sec) | Rendering: 0.009496 (26%) | DB: 0.001020 (2%) Which looks okay to a newbie like me. Here''s what WEBrick says though: => Rails application started on http://0.0.0.0:3000 [2005-03-24 11:02:14] INFO WEBrick 1.3.1 [2005-03-24 11:02:14] INFO ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.0] [2005-03-24 11:02:14] INFO WEBrick::HTTPServer#start: pid=568 port=3000 #<RuntimeError: bad header ''"load error: /Users/james/.irbrc\n"''.> ["/usr/local/lib/ruby/1.8/webrick/httputils.rb:143:in `parse_header''", "/usr/local/lib/ruby/1.8/webrick/httputils.rb:129:in `each''", "/usr/local/lib/ruby/1.8/webrick/httputils.rb:129:in `parse_header''", "/usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb: 93:in `handle_dispatch''", "/usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb: 35:in `do_GET''", "/usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__''", "/usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service''", "/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service''", "/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run''", "/usr/local/lib/ruby/1.8/webrick/server.rb:155:in `start_thread''", "/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start''", "/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start_thread''", "/usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start''", "/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each''", "/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start''", "/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start''", "/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start''", "/usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb: 21:in `dispatch''", "script/server:48"] [2005-03-24 11:02:56] ERROR `/contacts/list'' not found. 127.0.0.1 - - [24/Mar/2005:11:02:56 CST] "GET /contacts/list HTTP/1.1" 404 283 - -> /contacts/list Could some kind soul translate that error into English for me, please? Thank you. James Edward Gray II P.S. The database tables are in place and, I hope, setup correctly. They''re currently empty, if that matters.
On Thu, 24 Mar 2005 11:07:29 -0600, James Edward Gray II <james-AUi9nNu29NfWNcQ1/nO7itHuzzzSOjJt@public.gmane.org> wrote:> I''m working with my first Rails application now. I''ve put some > scaffold code in place and setup a few models with relationships, but > that''s all at this point. > > When I tried to reach the list method in the only controller I''ve built > I get a "Not Found" page. Looking in the log I see: > > # Logfile created on Thu Mar 24 11:02:13 CST 2005 by logger.rb/1.5.2.4 > > Processing ContactsController#list (for 127.0.0.1 at Thu Mar 24 > 11:02:56 CST 2005) > Parameters: {"action"=>"list", "controller"=>"contacts"} > [4;33mContact Load (0.000515) [1;37mSELECT * FROM contacts > Rendering contacts/list within layouts/contacts > [4;35mContact Columns (0.000505) [0;37mSHOW FIELDS FROM > contacts > Rendering layouts/contacts (200 OK) > Completed in 0.035439 (28 reqs/sec) | Rendering: 0.009496 (26%) | DB: > 0.001020 (2%) > > Which looks okay to a newbie like me. Here''s what WEBrick says though: > > => Rails application started on http://0.0.0.0:3000 > [2005-03-24 11:02:14] INFO WEBrick 1.3.1 > [2005-03-24 11:02:14] INFO ruby 1.8.2 (2004-12-25) > [powerpc-darwin7.7.0] > [2005-03-24 11:02:14] INFO WEBrick::HTTPServer#start: pid=568 port=3000 > #<RuntimeError: bad header ''"load error: /Users/james/.irbrc\n"''.> > ["/usr/local/lib/ruby/1.8/webrick/httputils.rb:143:in `parse_header''", > "/usr/local/lib/ruby/1.8/webrick/httputils.rb:129:in `each''", > "/usr/local/lib/ruby/1.8/webrick/httputils.rb:129:in `parse_header''", > "/usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb: > 93:in `handle_dispatch''", > "/usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb: > 35:in `do_GET''", > "/usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in > `__send__''", > "/usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in > `service''", "/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in > `service''", "/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in > `run''", "/usr/local/lib/ruby/1.8/webrick/server.rb:155:in > `start_thread''", "/usr/local/lib/ruby/1.8/webrick/server.rb:144:in > `start''", "/usr/local/lib/ruby/1.8/webrick/server.rb:144:in > `start_thread''", "/usr/local/lib/ruby/1.8/webrick/server.rb:94:in > `start''", "/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each''", > "/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start''", > "/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start''", > "/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start''", > "/usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb: > 21:in `dispatch''", "script/server:48"] > [2005-03-24 11:02:56] ERROR `/contacts/list'' not found. > 127.0.0.1 - - [24/Mar/2005:11:02:56 CST] "GET /contacts/list HTTP/1.1" > 404 283 > - -> /contacts/list > > Could some kind soul translate that error into English for me, please? > Thank you. > > James Edward Gray II > > P.S. The database tables are in place and, I hope, setup correctly. > They''re currently empty, if that matters. >> #<RuntimeError: bad header ''"load error: /Users/james/.irbrc\n"''.>Try moving or getting rid of your .irbrc file.
On Mar 24, 2005, at 11:21 AM, Joe Van Dyk wrote:> Try moving or getting rid of your .irbrc file.That did the trick. A few questions: 1. Why the heck is my .irbrc file involved? 2. Any workaround for this that will let me keep my beloved config file? Thanks again! James Edward Gray II
On Thu, 24 Mar 2005 11:27:41 -0600, James Edward Gray II <james-AUi9nNu29NfWNcQ1/nO7itHuzzzSOjJt@public.gmane.org> wrote:> On Mar 24, 2005, at 11:21 AM, Joe Van Dyk wrote: > > > Try moving or getting rid of your .irbrc file. > > That did the trick. A few questions: > > 1. Why the heck is my .irbrc file involved? > > 2. Any workaround for this that will let me keep my beloved config > file? > > Thanks again! > > James Edward Gray II >http://dev.rubyonrails.org/ticket/803
Joe Van Dyk wrote:> On Thu, 24 Mar 2005 11:27:41 -0600, James Edward Gray II > <james-AUi9nNu29NfWNcQ1/nO7itHuzzzSOjJt@public.gmane.org> wrote: > >>On Mar 24, 2005, at 11:21 AM, Joe Van Dyk wrote: >> >> >>>Try moving or getting rid of your .irbrc file. >> >>That did the trick. A few questions: >> >>1. Why the heck is my .irbrc file involved?So the debugger can be launched, is my understanding>>2. Any workaround for this that will let me keep my beloved config >>file? >> >>Thanks again! >> >>James Edward Gray II >> > > > http://dev.rubyonrails.org/ticket/803I don''t know how this can be worked around but i will observe that i don''t believe it is true that WEBrick *will not work* if you have an existing .irbc file. It''s been working for me for some time. I see warnings that a certain constant is my .irbc file is being redefined, but otherwise, everything works ok. Can''t say i understand why it isn''t working for some people and whether or not it''s because of something entirely proper they happen to have in that file that i don''t. craig
On Mar 24, 2005, at 11:55 AM, Joe Van Dyk wrote:> http://dev.rubyonrails.org/ticket/803Thanks. That helped me work out a solution. James Edward Gray II
On Mar 24, 2005, at 12:46 PM, craig duncan wrote:> I don''t know how this can be worked around but i will observe that i > don''t believe it is true that WEBrick *will not work* if you have an > existing .irbc file. It''s been working for me for some time.You''re exactly right. It only has trouble with certain irb constructs. For me, I believe it was the section of code setting my prompt. It is easy to work around, for any who are interested. Just wrap any problematic portions in a: if $0 == "irb" # trouble code goes here end This didn''t affects irb, but did satisfy WEBrick. James Edward Gray II