Topic: Error calling Dispatcher.dispatch

Hi,

I created an simple app (I am only learning Ruby on Rails) that I
uploaded on my server. While on my computer with Webbrick everything was
fine and working, now it is a totally different thing. I can't see
anything, the page is blank.

So I checked my routes, but everything was working on Webbrick, so it
should not be the routes. Then I deleted my app and created a new one
directly on the server. Adding only a home_controller file, a
home_helper file and a home folder in the views with a index.html.erb
file. The view is simple, just a few lines and a div. But the page is
still blank.

I then turned to the logs and I found an error message. Still, I cannot
fix it, it seems. Anyway, here is what I found in the "mongrel.log" file
:



Thu Aug 16 11:54:21 -0700 2012: Error calling Dispatcher.dispatch
#<NoMethodError: private method `split' called for nil:NilClass>
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/cgi_process.rb:52:in
`dispatch_cgi'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:101:in
`dispatch_cgi'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:27:in
`dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in
`process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in
`process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in
`each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in
`process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in
`initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in
`new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in
`initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in
`new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in
`each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in
`run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/bin/mongrel_rails:23:in `load'
/usr/bin/mongrel_rails:23


I don't know what it means. Thank you for helping.

Last edited by mathmoi (2012-08-16 15:22:13)

Re: Error calling Dispatcher.dispatch

#<NoMethodError: private method `split' called for nil:NilClass>

Sais that a method called split is being calld on an object of type nil
It also indicates that the nil class has got a method calld split but it's defined as a private or protected method not a public method and therefore not available to be called

Normally this sort of error would indicate that you are doing something like

@some_instance.split

when @some_instance has not been initialised to anything

However, from the stack trace you have shown it looks like a problem within the mongrel gem and nothing of your doing.
I believe there are known issues with particular versions of Ruby, Rails and mongrel.

You should ditch mongrel and use either webrick or unicorn as your server. Do that and I think your problems will magically dissap[ear (Probably to be replaced by new ones smile)

What you want and what you need are too often not the same thing!
When your head is hurting from trying to solve a problem, stop standing on it. When you are the right way up you will see the problem differently and you just might find the solution.
(Quote by me 15th July 2009)