Config.ru file for Rails 2.3.18 application

Does anyone know what the contents of config.ru for Rails 2.3.18 application should contain in production for work on Passenger / Unicorn / Puma?

So far I have received:

 # Require your environment file to bootstrap Rails require ::File.dirname(__FILE__) + '/config/environment' # Dispatch the request run ActionController::Dispatcher.new 

but it loads development instead of the correct working environment.

+4
source share
1 answer

Turns out this is the perfect config.ru .

The real problem is that the Unicorn -E RACK_ENV and Rails 2.3.18 parameter set needs RAILS_ENV to correctly define the environment.

So, at the top of config/environment.rb , I set ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] , and it works just fine.

+9
source

Source: https://habr.com/ru/post/1493115/


All Articles