Permalink
Browse files

Introduce RELATIVE_RAILS_ROOT and changed spawner script to use it. P…

…rior to this change spawner would assume the non symlinked deploy directory which made reaper reload the wrong code after further deployments.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6531 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 39ccb5e commit 7722e2bf6c8bc0e81e61a47809cdbbf52b33ce6b Tobias Lütke committed Apr 16, 2007
Showing with 5 additions and 4 deletions.
  1. +3 −3 railties/lib/commands/process/spawner.rb
  2. +2 −1 railties/lib/initializer.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',
@@ -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

0 comments on commit 7722e2b

Please sign in to comment.