Forum: Ruby on Rails Dispatch Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 DamnBigMan@gmail.com (Guest)
on 2007-07-30 17:01
(Received via mailing list)
I am suddenly having a strange error.  Whenever I try to do anything
in my rails application when it's running on WEBrick it just dies with
an ArgumentError 0 for 1 while in Mongrel it doesn't die but every
redirect_to generates a static page saying "you are being redirected"
it never actually redirects from this page though.

I've tried re-installing mongrel, activerecord and rails but that
doesn't seem to be helping.
931a7dbce1e64e15f6a8d4c1e2eb1e79?d=identicon&s=25 Chuck Vose (Guest)
on 2007-07-30 17:13
(Received via mailing list)
Please post the full backtrace generated by webrick and we may be able
to guide you a little better. Most likely it's a simple problem. In
your debugging you will probably never have to reinstall any of those
things (not set in stone of course, I'm sure some people have to but
it's a rarity. I've certainly never reinstalled them).

-Chuck Vose
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 DamnBigMan@gmail.com (Guest)
on 2007-07-30 17:19
(Received via mailing list)
Here is the Mongrel backtrace:

Mon Jul 30 09:05:16 -0600 2007: Error calling Dispatcher.dispatch
#<ArgumentError: wrong number of arguments (0 for 1)>
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1315:in `hash'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1315:in `[]'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1315:in `subclasses'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1316:in `subclasses'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:2159:in `inject'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1316:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1316:in `inject'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1316:in `subclasses'
C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:280:in `reset_subclasses'
C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:58:in
`reset_application!'
C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:116:in
`reset_after_dispatch'
C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:51:in
`dispatch'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:78:in `process'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:76:in `synchronize'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
rails.rb:76:in `process'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
618:in `process_client'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
617:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
617:in `process_client'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `initialize'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `new'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
736:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `initialize'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `new'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
720:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:271:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:270:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
configurator.rb:270:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:
127:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
command.rb:211:in `run'
C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:
243
C:\ruby\bin\mongrel_rails:16:in `load'
C:\ruby\bin\mongrel_rails:16
-e:3:in `load'
-e:3


And here is the WEBrick backtrace:

#<ArgumentError: wrong number of arguments (0 for 1)>
["C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1315:in `hash'", "C:/ruby/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/base.rb:1315:in `[]'", "C:/ruby/
lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:
1315:in `subclasses'", "C:/ruby/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/base.rb:1316:in `subclasses'",
"C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
base.rb:518:in `inject'", "C:/ruby/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/base.rb:1316:in `each'", "C:/
ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:1316:in `inject'", "C:/ruby/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/base.rb:1316:in `subclasses'",
"C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
base.rb:280:in `reset_subclasses'", "C:/ruby/lib/ruby/gems/1.8/gems/
rails-1.2.3/lib/dispatcher.rb:58:in `reset_application!'", "C:/ruby/
lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:116:in
`reset_after_dispatch'", "C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/
lib/dispatcher.rb:51:in `dispatch'", "C:/ruby/lib/ruby/gems/1.8/gems/
rails-1.2.3/lib/webrick_server.rb:113:in `handle_dispatch'", "C:/ruby/
lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in
`service'", "C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
`service'", "C:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'",
"C:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'", "C:/
ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'", "C:/ruby/lib/ruby/
1.8/webrick/server.rb:162:in `start_thread'", "C:/ruby/lib/ruby/1.8/
webrick/server.rb:95:in `start'", "C:/ruby/lib/ruby/1.8/webrick/
server.rb:92:in `each'", "C:/ruby/lib/ruby/1.8/webrick/server.rb:92:in
`start'", "C:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'", "C:/
ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'", "C:/ruby/lib/ruby/
gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in `dispatch'", "C:/
ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/comma[2007-07-30 09:17:07]
ERROR `/users/new' not found.
127.0.0.1 - - [30/Jul/2007:09:17:06 Mountain Daylight Time] "GET /
users/new HTTP/1.1" 404 279
- -> /users/new
nds/servers/webrick.rb:59", "C:/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `gem_original_require'", "C:/ruby/lib/ruby/
site_ruby/1.8/rubygems/custom_require.rb:27:in `require'", "C:/ruby/
lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
dependencies.rb:495:in `require'", "C:/ruby/lib/ruby/gems/1.8/gems/
activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in'", "C:/ruby/lib/ruby/gems/1.8/gems/
activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'", "C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/
server.rb:39", "C:/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:27:in `gem_original_require'", "C:/ruby/lib/ruby/
site_ruby/1.8/rubygems/custom_require.rb:27:in `require'", "./script/
server:3", "-e:4:in `load'", "-e:4"]


Basically I'm getting a 404 for any "page" when running WEBrick.
Mongrel serves the pages but chokes on any redirect_to statement.
Mongrel gives the error listed above for any and all requests but
renders the pages and handles data properly.
931a7dbce1e64e15f6a8d4c1e2eb1e79?d=identicon&s=25 Chuck Vose (Guest)
on 2007-07-30 17:38
(Received via mailing list)
Alright, I'll admit that I don't know what it is off the top of my
head. I'm sure it's user error because google isn't brimming with
answers to your question, but I'm not sure what kind of user error.

What I would suggest is to go out and get a copy of the ruby-debug
gem, include it in development.rb, and toss debugger in your
environment file somewhere. Step through your program and find out
where this mess is starting. (try `set autolist` then type `n` enter
once and then enter again and again until you see problems).

This has helped me time and time again when I just have no clue about
an error, hopefully it'll help you too.

The other option at hand is to diff with the latest revision if you're
using subversion and see what all you've changed. Also helpful and
sometimes much faster but not everyone is using version control. Also
not very helpful if you commit big changesets.

Hope that helps, you've got an interesting problem for sure.
Chuck Vose
B09a3f6cdc4797532647d2d264b5df49?d=identicon&s=25 Jodi Showers (jshow)
on 2007-07-30 17:47
(Received via mailing list)
DBM -

On 30-Jul-07, at 11:37 AM, Chuck Vose wrote:

>
>
>> C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/
>> base.rb:1316:in `subclasses'
>> C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
>> 736:in `run'
>> C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:
>> C:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/
>> And here is the WEBrick backtrace:
>> "C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/
>> `reset_after_dispatch'", "C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/
>> webrick/server.rb:95:in `start'", "C:/ruby/lib/ruby/1.8/webrick/
>> ERROR `/users/new' not found.
>> activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
>> renders the pages and handles data properly.
>>> -Chuck Vose
>>>> redirect_to generates a static page saying "you are being
>>>> redirected"
>>>> it never actually redirects from this page though.
>>>
>>>> I've tried re-installing mongrel, activerecord and rails but that
>>>> doesn't seem to be helping.
>>
>>
>>>
>>


In addition to Chuck's advice, I would first try to consider recent
changes.

When did this symptom appear. Can you revert to an earlier version.
Then slowly add back changes.

I've got a feeling it might be environment related - new plugin?
environment.rb change? routing change?

good luck. One's can be painful.

Jodi
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 DamnBigMan@gmail.com (Guest)
on 2007-07-30 18:14
(Received via mailing list)
Thanks, I'll give that a try.

It would seem that whatever I've done has broken entirely different
applications that worked that last time they were touched too.
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 DamnBigMan@gmail.com (Guest)
on 2007-07-30 19:04
(Received via mailing list)
Okay the last thing it tries to do before throwing the error is
reset_after_dispatch

I don't have any plugins currently installed for this application.  I
have acts_as_attachment installed in another application however that
shouldn't bleed over shout it?

I haven't changed much of the default setup for this one yet (it's
pretty simple).  I did uncomment the # map.connect ':controller/
service.wsdl', :action => 'wsdl' line in routes.  I tried commenting
it out again but that didn't help any.

Like Chuck says it must be my app but I have no idea what I could have
done to cause this.  I just tried running it on a clean install of
everything on a different machine and it is behaving the same way
which should permanently put to rest the slightest doubt that it is my
code that is doing it.

On Jul 30, 10:13 am, "DamnBig...@gmail.com" <DamnBig...@gmail.com>
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 DamnBigMan@gmail.com (Guest)
on 2007-07-30 22:14
(Received via mailing list)
Okay after stepping back, for lunch and other work, I have a good idea
of the general cause.  I just have to figure out what part of the
suspect code is causing the problem.

Thanks for your help guys.

On Jul 30, 11:02 am, "DamnBig...@gmail.com" <DamnBig...@gmail.com>
9d4960f8319664f0f7896230eebace73?d=identicon&s=25 DamnBigMan@gmail.com (Guest)
on 2007-07-31 18:45
(Received via mailing list)
It would appear that the source of the problem was somewhere in the
code for recipes 15.8 and 15.9 in the Ruby Cookbook.  I wasn't able to
figure out what was causing the problem so I ripped the whole thing
out and used a different resource.

That's what I get for being lazy and copying verbatim from a book.


On Jul 30, 2:13 pm, "DamnBig...@gmail.com" <DamnBig...@gmail.com>
0dbb834ba29d31a38ff23c493f099891?d=identicon&s=25 rami b (Guest)
on 2007-08-02 07:57
(Received via mailing list)
It looks like I'm getting the same error.  After upgrading to rails
1.2.3, I get the same dispatch error:

Wed Aug 01 22:44:37 -0700 2007: Error calling Dispatcher.dispatch
#<NameError: cannot remove Object::VERBOTEN_TAGS>


On Jul 31, 9:00 am, "DamnBig...@gmail.com" <DamnBig...@gmail.com>
Df762cd0caa328c997673b54f2f7cef4?d=identicon&s=25 RR (Guest)
on 2007-08-03 23:48
(Received via mailing list)
I began experiencing this same problem when I updated my app to Rails
1.2.3 and mongrel 1.0.1 on 2 Aug, a google search brought me straight
to this post.
This topic is locked and can not be replied to.