Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

"rails server" doesn't start mongrel by default

#3864

My environment: Windows XP, Ruby 1.8.7, Rails 3.0.0.beta, Mongrel gem installed

When issueing the command

rails server
in my application path, WEBrick is started, instead of Mongrel. From looking in the documentation, there seems to be no option for setting the server. I tried with
rails server mongrel
, but that doesn't work too.

One workaround I've found, is to call

rackup --server mongrel --port 3000
in your application path.

Reported by Torsten Maul · February 5th, 2010 @ 03:50 PM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: none

Activity

  1. Kieran P
    Kieran P
    • Tag set to bug, mongrel, regression, server

    +1 Mongrel should be preferred over thin, and then webrick

    February 6th, 2010 @ 08:42 AM

  2. José Valim
  3. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • State changed from new to open
    • Tag changed from bug, mongrel, regression, server to bug, mongrel, patch, regression, server
    • Assigned user set to José Valim

    The reason why rails server use Webrick over Mongrel was because the way gems area specify in the bundler. If you don't specify it in Gemfile, then rails server, or Rack more specifically, won't be able to use it.

    So here, I'm proposing the patch for adding two commented lines suggesting them to put gem 'mongel' in case they want to use Mongrel.

    @Kieran P

    Right now, the order of server, or handler, is specify by Rack. I don't know how could I patch that. Please see http://github.com/rack/rack/blob/master/lib/rack/handler.rb#L36 for more information.

    February 8th, 2010 @ 07:43 PM

  4. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)

    It seems like I need to add :group => :development for that Gemfile. Another patch ...

    February 9th, 2010 @ 08:54 AM

  5. Craig Buchek
    Craig Buchek

    While I'd prefer Mongrel to be used automatically, Prem's patch to add it (commented out) to the Gemfile seems to be a reasonable solution. The only way I can see to make it automatic would be something like this:

    gem "mongrel", :group => :development rescue nil

    But I don't know if that would work or make any sense.

    February 9th, 2010 @ 05:05 PM

  6. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • State changed from open to resolved

    Craig Buchek

    No, that won't do any good. If you specify that, Bundler would try to load/install the gem anyway.

    However, this patch is stale now by this commit from DHH, so I'll mark it as resolved. Seems like if you want to use Mongrel, uncommenting it from Gemfile would be a way to go.

    http://github.com/rails/rails/commit/834a45d8a2ae225b775c51d8ae266a...

    February 10th, 2010 @ 01:45 AM

  7. Jeremy Kemper
  8. bingbing
    bingbing
    • Tag changed from bug, mongrel, patch, regression, server to server, bug, mongrel, patch, regression

    March 26th, 2011 @ 02:09 AM