Can't force Rails into production environment via Passenger/Nginx

后端 未结 2 754
北荒
北荒 2021-02-06 11:18

I\'m having trouble getting a Rails app to run in the production environment via Phusion Passenger on Nginx/Ubuntu. According to the docs, the environment is controlled by the

相关标签:
2条回答
  • 2021-02-06 11:32

    Or try just removing 'config.ru' altogether. Nginx is smart about rails apps, and config.ru is not necessary for them.

    0 讨论(0)
  • 2021-02-06 11:52

    Workaround found at http://groups.google.com/group/phusion-passenger/browse_thread/thread/f91cd54bd379ad26/0a510133a080daac

    Add to config.ru:

    ENV['RAILS_ENV'] = ENV['RACK_ENV']  if !ENV['RAILS_ENV'] && ENV['RACK_ENV'] 
    
    0 讨论(0)
提交回复
热议问题