Topic: Getting me crazy: Stack level too deep

This problem is getting me crazy.

Trying to install the refinerycms at hostmonster with 0.9.7.12 version. I run another app @ hostmonster with refinerycms 0.9.6.31, which works.

For this newer refinery version, using rack 1.1.0, ruby 1.8.7

I was getting an error first, reported many times on the web, where a method could not be found:
undefined method `_rack_read_without_buffer'

Consulting the web, I found several sources saying I had to edit the fastcgi.rb file.
This reportedly was working for rack 1.0.0

The file looks like this now:
if defined? FCGI::Stream
  class FCGI::Stream
    def read(n, buffer=nil)
      buf = _rack_read_without_buffer n
      buffer.replace(buf.to_s)  if buffer
      buf
    end
    class_eval("alias _rack_read_without_buffer read")
  end
end

Now I am getting this error:

/!\ FAILSAFE /!\  Tue Aug 17 14:50:14 -0600 2010
  Status: 500 Internal Server Error
  stack level too deep
    /home/piertwom/.bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/fastcgi.rb:9:in `_rack_read_without_buffer'
    /home/piertwom/.bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/handler/fastcgi.rb:9:in `read'
    /home/piertwom/.bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/rewindable_input.rb:83:in `make_rewindable'


Ideas anyone??? Need this urgently as I have a client presentation to do!!! thanks sooooooo much!

Last edited by phonky (2010-08-17 17:32:41)

Re: Getting me crazy: Stack level too deep

After searching, that was to fix a bug in the 1.0 gem. It's obviously been changed since then, and the code now is causing an infinite recursion. I suppose you could try using rack 1.0 if possible, or find out why _rack_read_without_buffer is undefined in 1.10