From b72ca42199f82183c5ae17ed64a0e7f428298563 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Mon, 28 Dec 2009 15:00:38 -0600 Subject: [PATCH] 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 --- script/server | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/server b/script/server index 7a3e7a29..5c3b824f 100755 --- a/script/server +++ b/script/server @@ -1,5 +1,5 @@ #!/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. #require 'commands/server' @@ -20,7 +20,7 @@ options = { :Port => 2500, :Host => "0.0.0.0", :environment => (ENV['RAILS_ENV'] || "production").dup, - :config => RAILS_ROOT + "/config.ru", + :config => Rails.root.join('config.ru'), :detach => false, :debugger => false } @@ -64,7 +64,7 @@ end if options[:detach] 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) } at_exit { File.delete(pid) if File.exist?(pid) } end @@ -85,7 +85,7 @@ if File.exist?(options[:config]) inner_app = Object.const_get(File.basename(config, '.rb').capitalize) end else - require RAILS_ROOT + "/config/environment" + require Rails.root.join('config', 'environment') inner_app = ActionController::Dispatcher.new end