diff --git a/lib/passenger/railz/application_spawner.rb b/lib/passenger/railz/application_spawner.rb index 6ddf3e25ec..1d794e5601 100644 --- a/lib/passenger/railz/application_spawner.rb +++ b/lib/passenger/railz/application_spawner.rb @@ -148,7 +148,12 @@ def spawn_application! lower_privilege('config/environment.rb', @lowest_user) end remove_phusion_passenger_namespace - require 'config/environment' + + # require Rails' environment, using the same path as the original rails dispatcher, + # which normally does: require File.dirname(__FILE__) + "/../config/environment" + # thus avoiding the possibility of including the same file twice. + require 'public/../config/environment' + require 'dispatcher' end if success