# Dispatch Error

**URL:** <https://www.ruby-forum.com/t/dispatch-error/110751>\
**Category:** Rails\
**Created:** [July 30, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751 "2007-07-30T17:01:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/1 "2007-07-30T17:01:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/2 "2007-07-30T17:13:59Z")

</div>

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 V.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 5:19pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/3 "2007-07-30T17:19:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 5:47pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/4 "2007-07-30T17:47:06Z")

</div>

DBM -

On 30-Jul-07, at 11:37 AM, Chuck V. 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 V.
> > > 
> > > > 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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/5 "2007-07-30T17:38:02Z")

</div>

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 V.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 6:14pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/6 "2007-07-30T18:14:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 7:04pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/7 "2007-07-30T19:04:16Z")

</div>

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, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 30, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/8 "2007-07-30T22:14:44Z")

</div>

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, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 31, 2007, 6:45pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/9 "2007-07-31T18:45:12Z")

</div>

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, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 2, 2007, 7:57am UTC](https://www.ruby-forum.com/t/dispatch-error/110751/10 "2007-08-02T07:57:05Z")

</div>

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, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 3, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/dispatch-error/110751/11 "2007-08-03T23:48:15Z")

</div>

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.
