This project is archived and is in readonly mode.

#4690 ✓resolved
Edgars Beigarts

Mongrel doesn't work with rails 2.3.8

Reported by Edgars Beigarts | May 25th, 2010 @ 06:44 PM

All my apps stopped working with "mongrel_rails" when I upgraded from 2.3.5 to 2.3.8, but script/server still works with mongrel.
To reproduce, create a new rails application with simple "render :text => 'Ok'" action and run "mongrel_rails start".

$ mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).
** Rails signals registered.  HUP => reload (without restart).  It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:3000
** Use CTRL-C to stop.
Tue May 25 20:24:52 +0300 2010: Error calling Dispatcher.dispatch #<NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split>
/Users/be/.gem/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/cgi_process.rb:54:in `dispatch_cgi'
/Users/be/.gem/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
/Users/be/.gem/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:27:in `dispatch'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
/Users/be/.gem/ruby/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/Users/be/.gem/ruby/1.8/bin/mongrel_rails:19:in `load'
/Users/be/.gem/ruby/1.8/bin/mongrel_rails:19

Then I added a "puts" in actionpack-2.3.8/lib/action_controller/cgi_process.rb:54:

  if headers.include?('Set-Cookie')
+   puts "Headers: #{headers.inspect}"
    headers['cookie'] = headers.delete('Set-Cookie').split("\n")
  end

And got:

Headers: {"Status"=>"200", "ETag"=>"\"5b5af20a92f1dbe92328005329d1753f\"", "Content-Type"=>"text/html; charset=utf-8", "X-Runtime"=>"2", "Content-Length"=>"3", "Cache-Control"=>"private, max-age=0, must-revalidate"}

There is no Set-Cookie.

Versions:

ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
rack (1.1.0, 1.0.1, 1.0.0)

Comments and changes to this ticket

  • ...Paul

    ...Paul May 25th, 2010 @ 11:52 PM

    I'm getting a similar problem. script/server works fine, all good, but when I push out to my servers which use mongrel_cluster, when setting a cookie (such as after a login), I get the following:

    Error calling Dispatcher.dispatch #<NoMethodError: undefined method '[]' for nil:NilClass>
    .../mongrel/1.1.5/lib/mongrel/cgi.rb:108:in 'send_cookies'

    ruby 1.8.7 (2009-04-08 patchlevel 160) [amd-freebsd6]
    rack (1.1.0, 1.0.1)
    mongrel (1.1.5)
    mongrel_cluster (1.0.5)

    I did a rake rails:update, but did not note any changes resulting.

  • Edgars Beigarts

    Edgars Beigarts May 26th, 2010 @ 08:30 AM

    In some apps I also had the same issue that Paul has.

  • Evgeny

    Evgeny May 26th, 2010 @ 10:28 AM

    I have the same problem on hosting, even worse. When I create any app with a single scaffolded page the Mongrel returns a page as plain text. Here is the link to test page (won't be here for long): http://morningmare.com/users

    It seems like Mongrel crashes trying to send cookies. The response header has no Content-Type and it look like it's incomplete:
    curl 127.0.0.1:12002/users -I
    HTTP/1.1 200 OK
    Connection: close
    Date: Wed, 26 May 2010 09:24:44 GMT
    Content-Length: 0

    The Mongrel log shows the same error as Paul's:

    The error occurred while evaluating nil.[]>
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/cgi.rb:108:in send_cookies' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/cgi.rb:136:inout' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_response.rb:65:in start'

    ruby 1.8.7, mongrel 1.1.5

    Any help would be appreciated!

  • ...Paul

    ...Paul May 26th, 2010 @ 05:59 PM

    • Tag changed from 2.3.8, rack to 2.3.8, mongrel_cluster, rack

    Given that I know mongrel_cluster has fallen somewhat out of favor, I decided this might be the time to check out using Nginx with Passenger. Sure enough, the app works fine in that environment, so it's definitely some new incompatibility with mongrel_cluster 1.1.5...

  • Edgars Beigarts

    Edgars Beigarts May 26th, 2010 @ 07:03 PM

    The problem has been solved in http://github.com/rack/rack/commit/f6f3c60938ea3b08f3292a2480e6753c...

    Rack (HEAD and 1.0):

    >> h = Rack::Utils::HeaderHash.new
    => {}
    >> h.include?('Set-Cookie')
    => false
    >> h['Set-Cookie']
    => nil
    >> h.include?('Set-Cookie')
    => false
    

    Rack (1.1):

    >> h = Rack::Utils::HeaderHash.new
    => {}
    >> h.include?('Set-Cookie')
    => false
    >> h['Set-Cookie']
    => nil
    >> h.include?('Set-Cookie')
    => true
    
  • Edgars Beigarts

    Edgars Beigarts May 26th, 2010 @ 07:03 PM

    The problem has been solved in http://github.com/rack/rack/commit/f6f3c60938ea3b08f3292a2480e6753c...

    Rack (HEAD and 1.0):

    >> h = Rack::Utils::HeaderHash.new
    => {}
    >> h.include?('Set-Cookie')
    => false
    >> h['Set-Cookie']
    => nil
    >> h.include?('Set-Cookie')
    => false
    

    Rack (1.1):

    >> h = Rack::Utils::HeaderHash.new
    => {}
    >> h.include?('Set-Cookie')
    => false
    >> h['Set-Cookie']
    => nil
    >> h.include?('Set-Cookie')
    => true
    
  • ...Paul

    ...Paul May 26th, 2010 @ 07:11 PM

    How does that solve the problem, given that I have rack 1.1.0? (Rails 2.3.8 will complain loudly if you don't have that revision...)

  • Edgars Beigarts

    Edgars Beigarts May 26th, 2010 @ 07:58 PM

    Actually this solves only the first problem with "nil.split". :(

  • Jonny_K

    Jonny_K June 3rd, 2010 @ 03:21 PM

    • Tag changed from 2.3.8, mongrel_cluster, rack to 2.3.8, mongrel, mongrel_cluster, rack
  • demersus

    demersus June 4th, 2010 @ 11:11 PM

    I can confirm this issue is still happening. As of today. I just tried to deploy an app to a server with Rails 2.3.8 installed on it. It is running mongrel to serve the rails app.

    My log displays the exact same error as Edgar's first post.

    I keep getting a page with the following text: You are now being redirected
    Whenever the rails application sends a redirect. Instead of my browser redirecting.

    Also, if I try to submit a form it will kick back an error about an invalid authenticity token

    I was able to get my app deployed without error by downgrading to Rails 2.3.5

  • Togg

    Togg June 6th, 2010 @ 11:40 PM

    Same issue. Works for script/server, but server as cluster (for apache balancer) fails with the exact same error as above.

    So is there any patch available yet?

  • Mike C

    Mike C June 7th, 2010 @ 07:53 PM

    Same issue. Since nothing appears to have been done about it, I dug into it myself. Here is what I found:

    In file

    /var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/cgi.rb

    method

    def send_cookies(to)

    First, this method is half-baked. It has a hash variable called options which may never have been called until now. It is getting called now because the "cookie" is always a string -- never an Array nor Hash (at least in my tests). I'm not sure what is correct for this, but after tinkering around a bunch, I got this to work:

        when String
          cookies = cookie.split.map { |a| a[-1..-1]==';'?a[0..-2]:a }
          cookies.each do |c|
            if c.split('=').count == 2
              to['Set-Cookie'] = c
            else
              to['Set-Cookie'] = c+'='
            end
          end
        else
          to['Set-Cookie'] = cookie.to_s
        end
    

    I believe this was the code it replaced (I didn't save my original file -- bad me):

        else
          to['Set-Cookie'] = options['cookie'].to_s
        end
    

    I don't know if it is necessary to remove the ';'. I did and it works. I'll accept an official patch, but I'm done messing with it for now.

  • Scott Taylor
  • bshand

    bshand June 10th, 2010 @ 12:08 PM

    The fix currently in fauna/mongrel does not resolve this issue.

    Mike C was on the right track, but was too-aggressively splitting apart cookies.

    I attach rails238_mongrel115_patch.diff which resolves this for me -- I've tested this in Windows XP SP3 with all permutations of Ruby 1.8.6 vs 1.8.7, Rails 2.3.5 vs 2.3.8, on our in-house application.

    As described by others, this issue is only apparent if you start mongrel before Rails, e.g. as a service or using
    $ mongrel_rails start

    Here are telnet logs that I used as a manual test case to verify my fix:

    Expected behaviour (Rails 2.3.5, Ruby 1.8.6 without fix):

    $ telnet localhost 3000
    GET /login HTTP/1.0


    HTTP/1.1 200 OK Connection: close Date: Thu, 10 Jun 2010 10:43:02 GMT Set-Cookie: BALANCEID=balancer127-0-0-1_b73a.x4000; path=/; expires=Thu, 10-Jun-2010 22:43:03 GMT Set-Cookie: _era_session_1968=e36001c1bc0008535135dc9bf5b931ac; path=/; HttpOnly Status: 200 ETag: "49b3e5defddedb74868b40692f24ede1" X-Runtime: 593 Cache-Control: no-store Server: Mongrel 1.1.5 Content-Type: text/html; charset=utf-8 Content-Length: 4399


    <!DOCTYPE HTML SYSTEM "http://:/dtd/era.dtd?1261589568">

    Actual behaviour (Rails 2.3.8, Ruby 1.8.6 without fix):

    $ telnet localhost 3000
    GET /login HTTP/1.0


    HTTP/1.1 200 OK Connection: close Date: Thu, 10 Jun 2010 10:41:04 GMT Content-Length: 4399


    <!DOCTYPE HTML SYSTEM "http://:/dtd/era.dtd?1261589568">

    Fixed behaviour (Rails 2.3.8, Ruby 1.8.6 with fix):

    $ telnet localhost 3000
    GET /login HTTP/1.0


    HTTP/1.1 200 OK Connection: close Date: Thu, 10 Jun 2010 10:36:54 GMT Set-Cookie: BALANCEID=balancer127-0-0-1_dd1a.x4000; path=/; expires=Thu, 10-Jun-2010 22:36:55 GMT Set-Cookie: _era_session_1468=a62eda630f1846d621f100470fda693d; path=/; HttpOnly Status: 200 X-Runtime: 31 ETag: "c0e26ca3e1ca46f354d4bd134e0ef1c8" Cache-Control: no-store Server: Mongrel 1.1.5 Content-Type: text/html; charset=utf-8 Content-Length: 4399


    <!DOCTYPE HTML SYSTEM "http://:/dtd/era.dtd?1261589568">
  • Nat Brown

    Nat Brown June 16th, 2010 @ 06:02 PM

    for those of you still having issues, you do need to apply both the rack fix and the diff bshand posted.
    or if updating rack is tough, just make this change manually (sorry no diff) to gems/actionpack-2.3.8/lib/action_controller/cgi_process.rb at around :51.

            if headers.include?('Set-Cookie')
              headers['cookie'] = headers.delete('Set-Cookie').split("\n")
            end
    

    becomes

            if headers['Set-Cookie']
              headers['cookie'] = headers.delete('Set-Cookie').split("\n")
            end
    
  • ...Paul

    ...Paul June 23rd, 2010 @ 06:52 PM

    The simple fix natbro provided seems to have fixed the cookie issue, but redirects are still broken. Any redirect done results in page saying "You are being redirected" -- the redirect header, obviously not being transmitted in the response.

  • Matthew Denner

    Matthew Denner June 25th, 2010 @ 12:15 PM

    I don't know if this is relevant but in our environment (mongrel 1.1.5, rack 1.1.0, rails 2.3.8) the issue is actually with the 'header' method in lib/mongrel/cgi.rb. The Rack HeadersHash class appears to have different behaviour depending on whether you access a header directly or iterate over everything. In the 'header' method the latter is used, which causes @head['cookie'] to be a string, even though Rails sets an Array. By adding the following two lines:

     @head['cookie'] = options['cookie'] if options['cookie']
     options.delete('cookie')
    

    before:

      REMOVED_KEYS.each {|k| options.delete(k) }
    

    in the 'headers' method (about line 80-ish), we suddenly get not only the cookies but all of the headers our application sets, including the 'Location' header.

  • Matthew Denner

    Matthew Denner June 25th, 2010 @ 04:18 PM

    A little bit more investigation reveals that something really is odd with options['cookie'] in the 'header' method as it's an array of arrays, and the elements are not quite split properly (with a leading '\n'). The simplest solution for our environment was to monkeypatch Mongrel using a Rails initializer:

    class Mongrel::CGIWrapper
      def header_with_rails_fix(options = 'text/html')
        @head['cookie'] = options.delete('cookie').flatten.map { |v| v.sub(/^\n/,'') } if options.class != String and options['cookie']
        header_without_rails_fix(options)
      end
      alias_method_chain(:header, :rails_fix)
    end if Rails.version == '2.3.8' and Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) and self.class.const_defined?(:Mongrel)
    
  • Andrew Selder

    Andrew Selder June 28th, 2010 @ 07:07 PM

    +1 for Matthew's monkey patch above.

    This actually looks like a bug in Mongrel, specifically their handling off cookies when @head['cookies'] is a string

    In lib/mongrel/cgi.rb, I believe there is a bug in send_cookies. When @head['cookies'] is an array or a hash, it iterates over the values and to_s's them, but when it's something else and tries to to_s the value of options['cookie'].

    The simple change of modifying line 110 of cgi.rb
    from

    to

    to['Set-Cookie] = cookie.to_s

    seems to fix this problem as well.

  • Andrew Selder

    Andrew Selder June 28th, 2010 @ 07:08 PM

    Seems to have stripped the initial value of line 110 above

    to['Set-Cookie] = options['cookie'].to_s

  • Luis Lavena

    Luis Lavena July 1st, 2010 @ 05:23 AM

    Hello,

    As commented in Mongrel issue tracker:

    http://github.com/fauna/mongrel/issues#issue/5

    Due the nature of mongrel_rails, it will be great get a fix applied that works with older versions of Rails.

    Up to now, no patch has been proposed for this.

  • Ken Collins

    Ken Collins July 11th, 2010 @ 05:43 PM

    I took the throw it all at the wall approach and so far so good. I added this mongrel.rb to my config/initializers

    http://gist.github.com/471663

  • replicahandbag

    replicahandbag July 24th, 2010 @ 05:32 AM

    • Title changed from “Mongrel doesn't work with rails 2.3.8” to “[patch] - SQL Injection for :limit and :offset”
    • Assigned user set to “Andrew White”
    • Tag changed from 2.3.8, mongrel, mongrel_cluster, rack to replica watches, activerecord

    Holder, who said Mulberry replicathe probe “began some weeks agoreplica loewe handbags,” ed hardy clothing sale designer handbagsdeclined to specify which companiesMiu Miu replica are under investigation. He said he surveyed dolce gabbana bagsa portion of the damage, was briefed byreplica handbags Coast Guard officers andMiu Miu replica met with prosecutors for the areas coach replicaaffected by the spill.chanel offersceline replica handbags very unique and stylish coach replica handbags that catch the attention of all womenebel for sale. We also have many Luxurious louis designer watchesvuitton speedy handbags in different replica Piagetstyles and colors while at a competitive price. Audemars Piguet for saleclassic design of every burberry bag.Police wantRado for sale to know if you're offered designerCartier for sale item at a bargain price POLICE today croum for salewarned the public to be on their U-boat watchesguard if offered cheap Blancpain watches stolen from a Leeds top store.

  • bshand

    bshand July 27th, 2010 @ 10:11 AM

    Ken Collins' mongrel.rb initializer works for me -- on Windows with RubyGems 1.3.7 and Rails 1.8.6 (OneClick installer) / Rails 1.8.7 (RubyInstaller).

    It fails with RubyGems 1.3.5, unless I make the following addition patch to his mongrel.rb:

    $ diff mongrel.rb.orig mongrel.rb
    2c2
    < if Rails.version == '2.3.8' && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel)
    ---
    > if Rails.version == '2.3.8' && Gem.available?('mongrel', '~>1.1.5') && self.class.const_defined?(:Mongrel)
    

    To verify that the fix works with multiple cookies, here's my telnet log, as above.

    $ telnet localhost 3000
    GET /login HTTP/1.0
    
    HTTP/1.1 200 OK
    Connection: close
    Date: Tue, 27 Jul 2010 09:04:59 GMT
    Set-Cookie: BALANCEID=balancer127-0-0-1_37fc.x4000; path=/; expires=Tue, 27-Jul-2010 21:05:00 GMT
    Set-Cookie: _era_session_4964=c0ee034da3546146cfa92021312c8892; path=/; HttpOnly
    Status: 200
    X-Runtime: 688
    ETag: "170e02320aab49443d3f7235ef06feb7"
    Cache-Control: no-store
    Server: Mongrel 1.1.5
    Content-Type: text/html; charset=utf-8
    Content-Length: 4262
    
    <!DOCTYPE html>
    
  • matin

    matin July 27th, 2010 @ 03:10 PM

    Explore the world of erotic lingerie. Find the most erotic lingerie, hot underwear,
    babydoll, clubwear, teddies and more.
    erotic lingerie

    Dsquared2discount is the best online Dsquared shop where you can
    buy the Dsquared Jacket, Dsquared Jeans, Dsquared Shirt and more.
    Dsquared

    The most cool online shoes shop where you can find the most fashion designers shoes, include
    Manolo Blahnik shoes, Jimmy Choo shoes, Christian Louboutin shoes and more.
    we offer high quality highheels at low price.
    Manolo Blahnik Shoes
    Jimmy Choo Shoes
    Manolo Blahnik
    Jimmy Choo

    Cheap balenciaga purses, balenciaga handbags, balenciaga wallets onsale,
    Luxuy handbags, purses, high quality at low price at poboshop.com.
    balenciaga bags

  • timboisvert

    timboisvert July 30th, 2010 @ 04:14 PM

    Ken Collins' and bshand's solution worked for me. Thanks!

  • amnesia7

    amnesia7 August 2nd, 2010 @ 09:49 PM

    I'm new to RoR and my app is running from a shared host so bear with me.

    I've used the code by Ken Collins in a /config/initializers/mongrel.rb file but I'm still getting the issue.

    I've tried changing the first line of the file as per bshand's suggestion but no joy either, so I put it back to Ken's version again.

    My app (based on RefineryCMS) works fine on my localhost. However, on the shared host the frontend of my app runs ok (http://spectrumplastics.net:12001/) but when I try to go to the login area (http://spectrumplastics.net:12001/refinery) I get a page using Firefox that says "You are being redirected." If I click the link to go to session/new then the login fails. I assume a cookie should be set somewhere along the way.

    Here's what I can gather:
    mongrel 1.1.5
    rails 2.3.8
    rubygems-update 1.3.7

    Any help would be much appreciated.

    Col

  • Damien White

    Damien White August 3rd, 2010 @ 03:09 AM

    • Tag changed from 2.3.8, mongrel, mongrel_cluster, rack to 2, mongrel, mongrel_cluster, rack

    Ken,
    Thanks! Your solution worked great.

    -Damien

  • Damien White

    Damien White August 3rd, 2010 @ 03:12 AM

    • Tag changed from 2, mongrel, mongrel_cluster, rack to 2.3.8, mongrel, mongrel_cluster, rack
  • etlund

    etlund August 6th, 2010 @ 05:29 PM

    Ken's mongrel.rb initializer works for me on my Engine Yard cloud apps.

  • amnesia7

    amnesia7 August 6th, 2010 @ 06:12 PM

    My app seems to be working now using Ken's code.

    For some reason I had to comment out the "if" statement:

    if Rails.version == '2.3.8' && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel)

    and the associated "end" at the bottom.

    This line of code didn't seem to agree with the way my shared host is setup.

  • Eduardo

    Eduardo August 19th, 2010 @ 04:25 AM

    • Tag changed from 2.3.8, mongrel, mongrel_cluster, rack to 2, mongrel, mongrel_cluster, rack

    Ken Collins' solution did no work for me. This error is being shown whenever a redirect_to is being executed: "ActionController::RoutingError (No route matches "/404.shtml" with {:method=>:get}):
    config/initializers/mongrel.rb:63:in dispatch_cgi'"

    RubyGems 1.3.7
    Rails 2.3.8
    mongrel_cluster 1.0.5
    mongrel (1.1.5 ruby java x86-mingw32 x86-mswin32-60)
    ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
    rack 1.2.1

  • Mike Bethany

    Mike Bethany August 30th, 2010 @ 06:43 PM

    The great guys that put all the hard work into coming up with these fixes sometimes forget a few of us are new to all this and they assume a lot of steps. So, for the other complete ruby newbies like myself you have to do this:

    1. Save this ruby code in your app to config/mongrel.rb: http://gist.github.com/471663
    2. In your config/environment.rb under the "require 'boot'" line file add:
      require File.join(File.dirname(File.expand_path(FILE)), 'mongrel')
    3. In that same file add this line in the Rails::initializer.run block:
      config.gem "mongrel"

    Note: I've been adding the File.expand_path because that seems to fix a lot of "require 'blah_blah_blah' not found" bugs.

  • Mike Bethany

    Mike Bethany August 30th, 2010 @ 07:58 PM

    Major correction to my above statement:

    1. In your config/environment.rb at the very end of the file add:
      require File.join(File.dirname(File.expand_path(__FILE__)), 'mongrel')
  • replica handbags

    replica handbags September 8th, 2010 @ 05:46 AM

    designer replica handbags have become from more than a necessity to more of a fashion accessory. For ages now, women have been changing their fashion trends in clothes. This stands true for the fashion trends in their designer replica handbags as well. The changing styles in designer handbags that constituted the clutch style purses, oversized coach handbags, the hermes replica handbags, the satchel, the tote, the duffel to name a few are just a glimpse of how each style is unique in their own way and are hugely popular among ladies all over the world. Women are becoming more fashion conscious day-by-day due to the spread of media and the stress on celebrity fashion enhanced with a lot of hype on the prada handbags they sport. Everyone just dies to own a designer dior handbags but what people tend to forget is one should not exceed their limits in affordabilitys of certain luxuries in life that they can do without. ysl handbags come to the rescue of this situation in terms that these d&g handbags are highly affordable and yet they have the same appeal in them that the miu miu replica has. So when one can get the designs of their desire at cheaper rates then why go for its extravagant version just because it sports the name tag of the designer. Many of these celine bags may be very small in size and dont really serve the actual purpose of mulberry replica but they just look like a prize catch with their gorgeous designs. However, if you choose to pay exuberant prices for dior bags that doesnt even serve a basic storage purpose what would you do after a certain period of time when it goes out of fashion? You cannot just expect to carry around the same valentino handbags to all occasions and expect your friends to appreciate it again and again. The point here is that, ysl bags are mainly bought to show off the designer tag and that you are a faithful customer of that designer and that makes you a person of exceptional caliber and class. jimmy choo handbags have no difference in the looks criteria and they look exactly like a designer or any other branded mulberry bayswater. They are just manufactured in bulk and their prices comprise of their production cost only wherein no price is associated with a so called name tag. This makes it a highly economical and profitable choice of goods and saves you ample of money to shop more. You can in fact own more than one replica designer paul smith bag and match each of them according to your look or attire on any given day. Since designer jimmy choo replica handbags burn a hole in your pocket you cannot just buy too many of them and wear them according to the burberry replica. So replica coach is yet another advantage of replica burberry handbags and also these versace handbags are such good coach replica handbags in the true sense that no one really identifies the louis vuitton replica from the original. These louis vuitton replica handbags are readily available online at even more discounted rates and they offer you attractive deals for the same. You can always recommend your friends and neighbors about your smart move and they would appreciate your input in helping them save their hard earned money as well.

  • SUzB

    SUzB September 9th, 2010 @ 02:25 PM

    Thanks Mike! Your solution (August 30th, 2010 @ 06:43 PM and @ 07:58 PM) worked for me

  • Lenart

    Lenart September 13th, 2010 @ 08:31 PM

    Mikes solution can by simplified by creating mongrel.rb in config/initializers since Rails loads all the files from that folder automatically.

    I also had to change first line of this patch according to bshand's comment.

    Great work guys!

  • Steven Parkes

    Steven Parkes September 13th, 2010 @ 11:53 PM

    FWIW, this effects 2.3.9, too, but the mongrel.rb doesn't quite fit with 2.3.9 ...

  • Mauro Morales

    Mauro Morales October 7th, 2010 @ 06:24 AM

    As Lenart mentioned Mike's and bshand's comments fixed it for me to. Thank you guys! I was getting mental.

    Also, like Eduardo I was getting a routing error but in my case it was my bad since I was redirecting the address without a slash / at the end of my redirection, adding it fixed the problem.

  • David Trasbo

    David Trasbo October 7th, 2010 @ 09:08 PM

    • State changed from “new” to “resolved”
    • Importance changed from “” to “Low”

    Marking this as resolved for now.

    If this is still an issue, please note it here and I'll reopen. Patches with fixes/failing tests are much appreciated.

  • Andrea Campi

    Andrea Campi October 16th, 2010 @ 11:36 PM

    • Tag changed from 2, mongrel, mongrel_cluster, rack to 2-3-stable, mongrel, mongrel_cluster, rack
  • annabels

    annabels October 24th, 2010 @ 08:48 AM

    My app ran fine on my development laptop using webrick, but when I deployed it to the production server with mongrel_rails it developed two bugs:

    a. The content-type header of all the web pages it sent out was text/plain instead of text/html (which caused all pages to appear as black and white code in most browsers, and seemed to stop redirects working).

    b. I had to turn off the forgery prevention/authentication cookies.

    The Mike C, Lenart solution solved both issues (for Rails 2.3.8).

    Here is an idiot's guide - to save anyone having to trawl through all posts above to work it out:

    1. Download the file at http://gist.github.com/471663 and save to config/initializers/mongrel.rb in your application. (Then transfer to your production server obviously)

    2. Run mongrel_rails cluster::restart on your server.

    3. The first 2 steps solved both bugs for me - but if they don't make the change to mongrel.rb suggested by bshand above.

    Simple - only took a few minutes

  • jim123456

    jim123456 November 8th, 2010 @ 01:23 AM

    When Coach began as Manhattan Leather Bags in 1941, they were inspired by baseball glove design and they created discount handbags with similar qualities.supra shoes didn't come along until years later. The original handbag collection had twelve designs, and they were made from supple, tan, top-quality leathers, and showed the same excellent craftsmanship and stitching that we still expect today.

    Coach hired a woman named Bonnie Cashin in 1962, and she brought new looks to Coach bags. She used many new fabrics and organic materials like jersey and wool. She created the brass hardware that is symbolic of timberland boots. When Lew Frankfort came aboard in 1979, he brought Coach to the next level, and they became a name known the world over. Affordable luxury was not a concept that many people knew, but now they would. Soon after Frankfort joined Coach, they came out with a catalog, and opened their flagship store in New York City.

    In the 1980's, Coach expanded and made innovations that brought its brand relevance and strength. They designed watches starting in 1988, and also expanded their company to Tokyo. Japan still counts among the leading purchasers of coach purses and Coach heels. The manufacture of Coach shoes began in the mid 90's, and Reed Krakoff, the lead designer, loaned his talents to help put Coach heels and louis vuitton bags outlet on the map. Their shoes aren't as popular as their handbags, but they are well worth the money invested in their purchase.

    Women love heels, but at times you may want to wear shoes that don't have this height. true religion jeans outlet are as dedicated to comfort as they are to style and pizzazz. Coach platforms come in many styles, from gold loafers to slingbacks with open toes. You may be able to find Coach shoes at discount prices online, but be sure that you are buying genuine Coach products.

    If you're looking for moncler jackets that will make you feel and look glamorous, Coach shoes and chanel purses can do that well. Coach sneakers and heels will make you feel sporty, too. When selecting pumps or sandals to wear, you'll be happy to count on the long-standing quality and service of the Coach company. They have many styles to choose from, including chic and glamorous Coach boots and Coach heels. Whether you are looking for sports shoes like Coach sneakers or sexy shoes like Coach boots, the Coach name will never let you down.

  • jim123456

    jim123456 November 8th, 2010 @ 01:30 AM

    When Coach began as Manhattan Leather Bags in 1941, they were inspired by baseball glove design and they created discount handbags with similar qualities.supra shoes didn't come along until years later. The original handbag collection had twelve designs, and they were made from supple, tan, top-quality leathers, and showed the same excellent craftsmanship and stitching that we still expect today.

    Coach hired a woman named Bonnie Cashin in 1962, and she brought new looks to Coach bags. She used many new fabrics and organic materials like jersey and wool. She created the brass hardware that is symbolic of timberland boots. When Lew Frankfort came aboard in 1979, he brought Coach to the next level, and they became a name known the world over. Affordable luxury was not a concept that many people knew, but now they would. Soon after Frankfort joined Coach, they came out with a catalog, and opened their flagship store in New York City.

    In the 1980's, Coach expanded and made innovations that brought its brand relevance and strength. They designed watches starting in 1988, and also expanded their company to Tokyo. Japan still counts among the leading purchasers of coach purses and Coach heels. The manufacture of Coach shoes began in the mid 90's, and Reed Krakoff, the lead designer, loaned his talents to help put Coach heels and louis vuitton bags outlet on the map. Their shoes aren't as popular as their handbags, but they are well worth the money invested in their purchase.

    Women love heels, but at times you may want to wear shoes that don't have this height. true religion jeans outlet are as dedicated to comfort as they are to style and pizzazz. Coach platforms come in many styles, from gold loafers to slingbacks with open toes. You may be able to find Coach shoes at discount prices online, but be sure that you are buying genuine Coach products.

    If you're looking for moncler jackets that will make you feel and look glamorous, Coach shoes and chanel purses can do that well. Coach sneakers and heels will make you feel sporty, too. When selecting pumps or sandals to wear, you'll be happy to count on the long-standing quality and service of the Coach company. They have many styles to choose from, including chic and glamorous Coach boots and Coach heels. Whether you are looking for sports shoes like Coach sneakers or sexy shoes like Coach boots, the Coach name will never let you down.

  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer November 8th, 2010 @ 08:23 AM

    • Tag cleared.

    Automatic cleanup of spam.

  • Jeff Kreeftmeijer
  • zizilo

    zizilo December 31st, 2010 @ 02:38 AM

    For some reason I had to comment out the "if" statement:
    http://www.robesfr.com

  • afra99

    afra99 January 3rd, 2011 @ 06:09 AM

    It is true that monlcer online store we have been leading a difficult moncler life, for we need not only to be discount moncler jackets under various external pressures, but also to be in the moncler sale face of internal perplexities. Even a mere moncler jackets glance would make http://www.monclergo.com/ you moved and inpired.

  • afra99

    afra99 January 3rd, 2011 @ 06:10 AM

    A true love moncler clothing is what doesn‘t strive for busyness, for extravagance, for luxury, and moncler outewear moreover for hokum.There is someone that moncler coats is coming or passing away in your moncler life around the clock, so you may lose sight of those moncler jackets seen, and forget those http://www.monclerus.com/ remembered.

  • afra99

    afra99 January 3rd, 2011 @ 06:11 AM

    Some may be wicked, and some may be ugg boots sale despicable. Only when I put myself ugg boots in their position did I know they are more cheap ugg boots miserable than I. So forgive all that you have met discount ugg boots , no matter what kind of cheap ugg boots sale persons they are. From that you would get angry with your http://www.goodfurboots.com/ friends, we can conclude you sitll care about the friendship between you.

  • afra99

    afra99 January 3rd, 2011 @ 06:12 AM

    Happiness is accompanied by ugg boots sale sorrow, and it would turn discount ugg boots sunny after rain as well. If rain remains after rain and sorrow ugg boots remains after sorrow, please take those ugg australia boots farewells easy, and turn to smilingly look for yourself who is never to appear http://www.topuggworld.com/ .

  • afra99

    afra99 January 3rd, 2011 @ 06:13 AM

    Happiness christian louboutin sale is like a pebble dropped into a christian louboutin pool to set in motion an ever-widening circle of christian louboutin shoes ripples. As Stevenson has said christian louboutin boots, being happy is a tory borch shoes duty. There is no exact definition of the http://www.christianlouboutinshoestore.com/ word happiness.

  • afra99

    afra99 January 3rd, 2011 @ 06:14 AM

    Maybe God wants us to meet cheap ed hardy clothing sale a few wrong people before meeting the right womens ed hardy clothing one, so that when we finally meet the ed hardy online shop person, we will know how to be grateful ed hardy clothing .Do not cry because it is mens moncler jackets over, smile because it happened http://www.edhardy-buy.com/ .

  • afra99

    afra99 January 3rd, 2011 @ 06:15 AM

    I would not care success christian louboutin shoes or failure, for I will only struggle louboutin sale ahead as long as I have been destined to the discount christian louboutin shoes distance. I would not care the christian louboutin booties difficulties around, for what I can leave on the christian louboutin boots earth is only their view of my back since I have been marching toward the http://www.louboutinszone.com/ horizontal.

  • afra99

    afra99 January 3rd, 2011 @ 06:16 AM

    The tragedy of louboutin shoes life is not so much what men suffer, but what christian louboutin sale they miss. I find life an exciting christian louboutin shoes business and most exciting when it is lived for discount christian louboutin others. Young men make great mistakes in christian louboutin pumps life for one thing, they idealize love http://www.louboutinsonline.com/ too much.

  • Woody

    Woody January 24th, 2011 @ 07:46 PM

    I was hesitant to monkey-patch w/o a better understanding of the problem. A summary of what I've found about the bug:

    The OP's problem (calling nil.split) won't be resolved until rails 2 depends on a version of rack that has either https://github.com/rack/rack/commit/f6f3c60938ea3b08f3292a2480e6753... or https://github.com/rack/rack/commit/b937c01bd16243276b24845efea4119... in it (v1.2 or master, respectively). Until then, monkey patching will be necessary to get mongrel_rails working due to it's use of Mongrel::CGIWrapper (script/server does not "require 'mongrel/rails'", which uses Mongrel's CGI wrapper, which in turn uses rack, which in version 1.1 has a bug that chokes on rails' cgi handling of mongrel's 'Set-Cookie'). OR, Rails' cgi handling could not use headers.include?, but that's a work-around.

    Also, FYI, the other bug mentioned here (calling nil.[]) is from a bug in Mongrel's CGI wrapper resolved 2 years ago, but still existing in Mongrel 1.1.5. Once the OP's bug is fixed, this case is hit because somewhere between Rails' mongrel-specific CGI code (see https://github.com/rails/rails/commit/b6e56efe) setting 'cookie' to an array and where mongrel looks at 'cookie' (https://github.com/fauna/mongrel/blob/rel_1-1-5/lib/mongrel/cgi.rb, 'send_cookie'), the 'cookie' header gets set back to a string, effectively nullifying that commit and triggering the old bug. I couldn't find where that happens, and won't be resolved until rails/rack/whatever doesn't un-array the 'cookie' header, or a new version of mongrel comes out.

    The gist: Mongrel's CGI doesn't work in Rails 2.3.8+ w/o monkey patching 2 separate (old) bugs, one for Rack, and the other for Mongrel.

  • jordan sixty plus
  • Roberto Aguilar

    Roberto Aguilar February 14th, 2011 @ 10:40 PM

    We spent a while researching this problem and ended up here to get the problem solved, but we have a quick note that hopefully will save others some time. When pulling the 'mongrel.rb' initializer file from Github, there are edits in the comments to address different versions of Rails as well as some incorrect syntax for a condition about the Mongrels which may give you an 'illformed requirement' error. A version of the gist that works for us can be found below. It has been tweaked to work for Rails versions ['2.3.8', '2.3.9', '2.3.10', '2.3.11'].

    Thanks.

    https://gist.github.com/826692

  • cheap coach bags

    cheap coach bags March 3rd, 2011 @ 08:32 AM

    Well, it's very waste and not only you but also crazed at nowadays. coach outlet And you very well dress't yearn to stutter exporting your car honorable because you bought the Coach Handbag for manually.Nevertheless stitch! Can each prepare a School Container? No, they can't. The shortfall to be told them? When you loss Implant Handbags.You are a sis. And you are hunting for Guide Market Coupons. But also many others push the bundle. They enterprise are an alias inflection for sex. Guide coach online and
    discount coach are not only tidy But do you catch how to have an extensive hear in structure to have a Implant Note or any other inhabitants come across at a muddled emolument, haw be you are looking for a Direct Purse at the same demand in their clothes and creeps the other accessories from Show that is. Unquestionably, it is fresh to advert that Guide is a specializer variety, And why shouldn't they? And the prices They may scuff that riveting clothes to the get-together but with that Nurture Container, coach us they can append an eloquent sumptuousness to their hearts.

  • af001

    af001 May 5th, 2011 @ 02:52 AM

    私の中で、総合評価のとっても低いアバアバクロホリスタークロ銀座店。アバクロは大好きなんですけどね。一昨日の東京駅付近での打ち合わせの後、散歩がてら久々に行ってきました。

  • csnk
  • learn italian online

    learn italian online May 19th, 2011 @ 04:17 AM

    brick, but when I deployed Ray Ban 2140 it to the production server with mongrel_rails it developed two Ray Ban 3025 bugs:a. The content-type header of all the web pages it sent out wa

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Shared Ticket Bins

Referenced by

Pages