Better handling of pathnames with spaces
This seems to be a problem, particularly on Windows. See if we can work around it, by updating script/server
This commit is contained in:
parent
2780344a1b
commit
b72ca42199
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require File.dirname(__FILE__) + '/../config/boot'
|
require File.join(File.dirname(__FILE__), '..', 'config', 'boot')
|
||||||
# Don't do this. Instead, put it here, where we can customize it.
|
# Don't do this. Instead, put it here, where we can customize it.
|
||||||
#require 'commands/server'
|
#require 'commands/server'
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ options = {
|
||||||
:Port => 2500,
|
:Port => 2500,
|
||||||
:Host => "0.0.0.0",
|
:Host => "0.0.0.0",
|
||||||
:environment => (ENV['RAILS_ENV'] || "production").dup,
|
:environment => (ENV['RAILS_ENV'] || "production").dup,
|
||||||
:config => RAILS_ROOT + "/config.ru",
|
:config => Rails.root.join('config.ru'),
|
||||||
:detach => false,
|
:detach => false,
|
||||||
:debugger => false
|
:debugger => false
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ end
|
||||||
|
|
||||||
if options[:detach]
|
if options[:detach]
|
||||||
Process.daemon
|
Process.daemon
|
||||||
pid = "#{RAILS_ROOT}/tmp/pids/server.pid"
|
pid = Rails.root.join('tmp', 'pids', 'server.pid')
|
||||||
File.open(pid, 'w'){ |f| f.write(Process.pid) }
|
File.open(pid, 'w'){ |f| f.write(Process.pid) }
|
||||||
at_exit { File.delete(pid) if File.exist?(pid) }
|
at_exit { File.delete(pid) if File.exist?(pid) }
|
||||||
end
|
end
|
||||||
|
@ -85,7 +85,7 @@ if File.exist?(options[:config])
|
||||||
inner_app = Object.const_get(File.basename(config, '.rb').capitalize)
|
inner_app = Object.const_get(File.basename(config, '.rb').capitalize)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
require RAILS_ROOT + "/config/environment"
|
require Rails.root.join('config', 'environment')
|
||||||
inner_app = ActionController::Dispatcher.new
|
inner_app = ActionController::Dispatcher.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue