rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Dispatcher failed to catch: undefined method `read' for class  `FCGI::Stream' (NameError)
@ 2009-07-23 20:05 nreckart
  2009-07-24 13:18 ` Nathan Reckart
  0 siblings, 1 reply; 4+ messages in thread
From: nreckart @ 2009-07-23 20:05 UTC (permalink / raw)
  To: Rack Development


I have a Rails site hosted on Bluehost, which recently upgraded to
Rails 2.3.3. When they did so, it broke my site, which was frozen to
Rails 2.3.2. In my fastcgi.crash.log I found the following.

[23/Jul/2009:10:00:28 :: 23983] Dispatcher failed to catch: undefined
method `read' for class `FCGI::Stream' (NameError)  /usr/lib/ruby/
gems/
1.8/gems/rack-1.0.0/lib/rack/handler/fastcgi.rb:7
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
103:in `process_request'  /home/username/rails/app/vendor/rails/
railties/lib/fcgi_handler.rb:153:in `with_signal_handler'
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
101:in `process_request'
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
78:in `process_each_request'
  /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:117:in
`session'  /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:104:in
`each_request'
  /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:36:in `each'
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
77:in `process_each_request'
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
76:in `catch'  /home/username/rails/app/vendor/rails/railties/lib/
fcgi_handler.rb:76:in `process_each_request'
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
51:in `process!'
  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
23:in `process!'
  dispatch.fcgi:24
unhandled dispatch error

To fix the problem, I installed the rack gem locally on my Bluehost
account. I then edited the rack-1.0.0/lib/rack/handler/fastcgi.rb file
and moved line 7, which aliases the read method, to after the read
method definition instead of before it. All was well with the world
again after I told my rails app to use the local gem instead of the
global system gem.

I'd be happy to submit a patch if needed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Dispatcher failed to catch: undefined method `read' for class  `FCGI::Stream' (NameError)
  2009-07-23 20:05 Dispatcher failed to catch: undefined method `read' for class `FCGI::Stream' (NameError) nreckart
@ 2009-07-24 13:18 ` Nathan Reckart
  2009-07-26 23:05   ` Hongli Lai
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Reckart @ 2009-07-24 13:18 UTC (permalink / raw)
  To: Rack Development


Below is the patch that I used to fix the issue. Sorry if this the
preferred method for submitting patches.

------------------------------------------------------------------------------------------------

diff --git a/lib/rack/handler/fastcgi.rb b/lib/rack/handler/fastcgi.rb
index 11e1fca..83cbd83 100644
--- a/lib/rack/handler/fastcgi.rb
+++ b/lib/rack/handler/fastcgi.rb
@@ -4,13 +4,13 @@ require 'rack/content_length'
 require 'rack/rewindable_input'

 class FCGI::Stream
-  alias _rack_read_without_buffer read
-
   def read(n, buffer=nil)
     buf = _rack_read_without_buffer n
     buffer.replace(buf.to_s)  if buffer
     buf
   end
+
+  alias _rack_read_without_buffer read
 end

 module Rack

------------------------------------------------------------------------------------------------

On Thu, Jul 23, 2009 at 4:05 PM, nreckart<nreckart@gmail.com> wrote:
> I have a Rails site hosted on Bluehost, which recently upgraded to
> Rails 2.3.3. When they did so, it broke my site, which was frozen to
> Rails 2.3.2. In my fastcgi.crash.log I found the following.
>
> [23/Jul/2009:10:00:28 :: 23983] Dispatcher failed to catch: undefined
> method `read' for class `FCGI::Stream' (NameError)  /usr/lib/ruby/
> gems/
> 1.8/gems/rack-1.0.0/lib/rack/handler/fastcgi.rb:7
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 103:in `process_request'  /home/username/rails/app/vendor/rails/
> railties/lib/fcgi_handler.rb:153:in `with_signal_handler'
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 101:in `process_request'
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 78:in `process_each_request'
>  /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:117:in
> `session'  /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:104:in
> `each_request'
>  /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:36:in `each'
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 77:in `process_each_request'
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 76:in `catch'  /home/username/rails/app/vendor/rails/railties/lib/
> fcgi_handler.rb:76:in `process_each_request'
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 51:in `process!'
>  /home/username/rails/app/vendor/rails/railties/lib/fcgi_handler.rb:
> 23:in `process!'
>  dispatch.fcgi:24
> unhandled dispatch error
>
> To fix the problem, I installed the rack gem locally on my Bluehost
> account. I then edited the rack-1.0.0/lib/rack/handler/fastcgi.rb file
> and moved line 7, which aliases the read method, to after the read
> method definition instead of before it. All was well with the world
> again after I told my rails app to use the local gem instead of the
> global system gem.
>
> I'd be happy to submit a patch if needed.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Dispatcher failed to catch: undefined method `read' for class  `FCGI::Stream' (NameError)
  2009-07-24 13:18 ` Nathan Reckart
@ 2009-07-26 23:05   ` Hongli Lai
  2009-07-27 14:10     ` nreckart
  0 siblings, 1 reply; 4+ messages in thread
From: Hongli Lai @ 2009-07-26 23:05 UTC (permalink / raw)
  To: Rack Development


On Jul 24, 3:18 pm, Nathan Reckart <nreck...@gmail.com> wrote:
> Below is the patch that I used to fix the issue. Sorry if this the
> preferred method for submitting patches.

Please submit the patch to Lighthouse and post a link here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Dispatcher failed to catch: undefined method `read' for class  `FCGI::Stream' (NameError)
  2009-07-26 23:05   ` Hongli Lai
@ 2009-07-27 14:10     ` nreckart
  0 siblings, 0 replies; 4+ messages in thread
From: nreckart @ 2009-07-27 14:10 UTC (permalink / raw)
  To: Rack Development


I created a Lighthouse ticket and included the patch.

http://rack.lighthouseapp.com/projects/22435-rack/tickets/61


On Jul 26, 7:05 pm, Hongli Lai <hon...@phusion.nl> wrote:
> On Jul 24, 3:18 pm, Nathan Reckart <nreck...@gmail.com> wrote:
>
> > Below is the patch that I used to fix the issue. Sorry if this the
> > preferred method for submitting patches.
>
> Please submit the patch to Lighthouse and post a link here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-27 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-23 20:05 Dispatcher failed to catch: undefined method `read' for class `FCGI::Stream' (NameError) nreckart
2009-07-24 13:18 ` Nathan Reckart
2009-07-26 23:05   ` Hongli Lai
2009-07-27 14:10     ` nreckart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).