aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/commands/server.rb')
-rw-r--r--railties/lib/commands/server.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb
index 64e5b1fa7a..ab22f2c565 100644
--- a/railties/lib/commands/server.rb
+++ b/railties/lib/commands/server.rb
@@ -1,12 +1,18 @@
require 'active_support'
+begin
+ require 'fcgi'
+rescue Exception
+ # FCGI not available
+end
+
server = case ARGV.first
when "lighttpd"
ARGV.shift
when "webrick"
ARGV.shift
else
- if RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank?
+ if RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI)
"lighttpd"
else
"webrick"