aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands/servers/mongrel.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/commands/servers/mongrel.rb')
-rw-r--r--railties/lib/commands/servers/mongrel.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/commands/servers/mongrel.rb b/railties/lib/commands/servers/mongrel.rb
index e5bde9fe1b..63dd6bd71c 100644
--- a/railties/lib/commands/servers/mongrel.rb
+++ b/railties/lib/commands/servers/mongrel.rb
@@ -33,8 +33,11 @@ end
puts "=> Rails application starting on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
if OPTIONS[:detach]
- `mongrel_rails start -d -p #{OPTIONS[:port]} -a #{OPTIONS[:ip]} -e #{OPTIONS[:environment]}`
+ `mongrel_rails start -d -p #{OPTIONS[:port]} -a #{OPTIONS[:ip]} -e #{OPTIONS[:environment]} -P #{RAILS_ROOT}/tmp/pids/mongrel.pid`
else
+ ENV["RAILS_ENV"] = OPTIONS[:environment]
+ RAILS_ENV.replace(OPTIONS[:environment]) if defined?(RAILS_ENV)
+
require 'initializer'
Rails::Initializer.run(:initialize_logger)