Hostmonster 500 error/dispatch Problem
The following error was found in my fastcgi.crash.log
[23/Jul/2009:10:00:28 :: 23983] Dispatcher failed to catch: undefined
method `read’ for class `FCGI::Stream’ (NameError) /usr/lib/ruby/gems/
103:in `process_request’ /home/username/rails/app/vendor/rails/
76:in `catch’ /home/username/rails/app/vendor/rails/railties/lib/
unhandled dispatch error
Josh’s message got me on the right track to a fix, but didn’t quite
work. I believe this is in fact a bug in the rack gem.
Step 1: Install the rack gem locally
gem install rack
Step 2: Fix the bug in the locally installed rack gem
Move line #7 to just below the definition of the read method. It
should look as follows.
def read(n, buffer=nil)
buf = _rack_read_without_buffer n
buffer.replace(buf.to_s) if buffer
alias _rack_read_without_buffer read
You can determine the path to your locally installed gems by running
‘gem env’. Look for ‘INSTALLATION DIRECTORY’.
Step 3: Tell your rails app to use the local gem instead of the system
Edit the environment.rb file for your application and add the
following to the top.
ENV[‘GEM_PATH’] = ‘/path/to/local/ruby/gems’
Use the path exactly as listed next to ‘INSTALLATION DIRECTORY’ when
you run ‘gem env’. In my case, it was /home/username/ruby/gems. You
should not need to specify the path to the global system gems.
Step 4: Kill any running dispatch.fcgi processes
killall -u username dispatch.fcgi
Step 5: Try to access your app
At this point my rails app started with no problem.
Got from : http://aspn.activestate.com/ASPN/Mail/Message/ruby-talk/3732081