diff --git a/lib/capybara/server.rb b/lib/capybara/server.rb index acdf8afd..9bffb3d9 100644 --- a/lib/capybara/server.rb +++ b/lib/capybara/server.rb @@ -51,9 +51,9 @@ class Capybara::Server Timeout.timeout(10) do Thread.new do - if defined?(Rack::Handler::Mongrel) + begin Rack::Handler::Mongrel.run(Identify.new(@app), :Port => port) - else + rescue LoadError Rack::Handler::WEBrick.run(Identify.new(@app), :Port => port, :AccessLog => []) end end