mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
c5d5c4f708
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3851 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
34 lines
707 B
Ruby
34 lines
707 B
Ruby
require 'active_support'
|
|
|
|
begin
|
|
require_library_or_gem '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? && defined?(FCGI)
|
|
"lighttpd"
|
|
else
|
|
"webrick"
|
|
end
|
|
end
|
|
|
|
if server == "webrick"
|
|
puts "=> Booting WEBrick..."
|
|
else
|
|
puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)"
|
|
end
|
|
|
|
require_library_or_gem 'rake'
|
|
load File.join(File.dirname(__FILE__), "..", "tasks", "tmp.rake")
|
|
begin
|
|
Rake::Task['tmp:create'].execute
|
|
rescue Errno::EEXIST => e
|
|
end
|
|
require "commands/servers/#{server}"
|