Does anyone know what the contents of config.ru
should be for a Rails 2.3.18 app in production to run on Passenger/Unicorn/Puma?
So far I've got:
# Require your environment file to bootstrap Rails
require ::File.dirname(__FILE__) + '/config/environment'
# Dispatch the request
run ActionController::Dispatcher.new
but it's loading development
instead of the correct production environment.
It turns out this is a perfect config.ru
.
The real problem is that Unicorn's -E
parameter sets RACK_ENV
and Rails 2.3.18 needs RAILS_ENV
in order to correctly detect the environment.
So, at the top of config/environment.rb
, I've set ENV["RAILS_ENV"] ||= ENV["RACK_ENV"]
and this is working just great.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With