diff --git a/railties/lib/commands/process/spawner.rb b/railties/lib/commands/process/spawner.rb index 0a34bd6e4b9e4..8fdfab945a3b2 100644 --- a/railties/lib/commands/process/spawner.rb +++ b/railties/lib/commands/process/spawner.rb @@ -114,9 +114,9 @@ def self.can_bind_to_custom_address? OPTIONS = { :environment => "production", :spawner => '/usr/bin/env spawn-fcgi', - :dispatcher => File.expand_path(RAILS_ROOT + '/public/dispatch.fcgi'), - :pids => File.expand_path(RAILS_ROOT + "/tmp/pids"), - :rails_root => File.expand_path(RAILS_ROOT), + :dispatcher => File.expand_path(RELATIVE_RAILS_ROOT + '/public/dispatch.fcgi'), + :pids => File.expand_path(RELATIVE_RAILS_ROOT + "/tmp/pids"), + :rails_root => File.expand_path(RELATIVE_RAILS_ROOT), :process => "dispatch", :port => 8000, :address => '0.0.0.0', diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 6b9a5ae2aeaf7..b391be6accd71 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -502,7 +502,8 @@ def set_root_path! else Pathname.new(::RAILS_ROOT).realpath.to_s end - + + Object.const_set(:RELATIVE_RAILS_ROOT, ::RAILS_ROOT.dup) unless defined?(::RELATIVE_RAILS_ROOT) ::RAILS_ROOT.replace @root_path end