aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/commands')
-rw-r--r--railties/lib/commands/server.rb8
-rw-r--r--railties/lib/commands/servers/lighttpd.rb9
2 files changed, 13 insertions, 4 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"
diff --git a/railties/lib/commands/servers/lighttpd.rb b/railties/lib/commands/servers/lighttpd.rb
index df6ad663f9..488c7d61c4 100644
--- a/railties/lib/commands/servers/lighttpd.rb
+++ b/railties/lib/commands/servers/lighttpd.rb
@@ -1,7 +1,10 @@
-require 'active_support'
-
unless RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank?
- puts "lighttpd is not available on your system (or not in your path)"
+ puts "PROBLEM: Lighttpd is not available on your system (or not in your path)"
+ exit 1
+end
+
+unless defined?(FCGI)
+ puts "PROBLEM: Lighttpd requires that the FCGI Ruby bindings are installed on the system"
exit 1
end