mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
script/server should init Rails by loading config.ru
Fixes "Rails 3.0 doesn't fucking work"
This commit is contained in:
parent
f6f416c58e
commit
bdf8ee44c5
2 changed files with 8 additions and 18 deletions
|
@ -37,15 +37,6 @@ module Rails
|
|||
Options.new
|
||||
end
|
||||
|
||||
def self.start(app)
|
||||
new(app).start
|
||||
end
|
||||
|
||||
def initialize(app)
|
||||
super() # Call Rack::Server#initialize without passing any options to use.
|
||||
@app = app
|
||||
end
|
||||
|
||||
def start
|
||||
puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}"
|
||||
puts "=> Rails #{Rails.version} application starting on http://#{options[:Host]}:#{options[:Port]}"
|
||||
|
@ -69,20 +60,17 @@ module Rails
|
|||
end
|
||||
|
||||
def log_path
|
||||
"#{File.expand_path(@app.root)}/log/#{options[:environment]}.log"
|
||||
"log/#{options[:environment]}.log"
|
||||
end
|
||||
|
||||
def default_options
|
||||
{
|
||||
super.merge({
|
||||
:Port => 3000,
|
||||
:Host => "0.0.0.0",
|
||||
:environment => (ENV['RAILS_ENV'] || "development").dup,
|
||||
:rack_file => "#{@app.root}/config.ru",
|
||||
:daemonize => false,
|
||||
:debugger => false,
|
||||
:pid => "#{@app.root}/tmp/pids/server.pid",
|
||||
:AccessLog => []
|
||||
}
|
||||
:pid => "tmp/pids/server.pid"
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require File.expand_path('../../config/application', __FILE__)
|
||||
require File.expand_path('../../config/boot', __FILE__)
|
||||
require 'rails/commands/server'
|
||||
Rails::Server.start(<%= app_const %>.instance)
|
||||
|
||||
Dir.chdir(File.expand_path('../..', __FILE__))
|
||||
Rails::Server.start
|
||||
|
|
Loading…
Reference in a new issue