【问题标题】:config.ru file for Rails 2.3.18 appRails 2.3.18 应用程序的 config.ru 文件
【发布时间】:2013-07-23 11:39:08
【问题描述】:

有谁知道config.ru 的内容应该是什么,才能让生产中的 Rails 2.3.18 应用程序在Passenger/Unicorn/Puma 上运行?

到目前为止,我得到了:

# Require your environment file to bootstrap Rails
require ::File.dirname(__FILE__) + '/config/environment'

# Dispatch the request
run ActionController::Dispatcher.new

但它正在加载 development 而不是正确的生产环境。

【问题讨论】:

    标签: ruby-on-rails rack unicorn


    【解决方案1】:

    事实证明这是一个完美的config.ru

    真正的问题是Unicorn的-E参数集RACK_ENV和Rails 2.3.18需要RAILS_ENV才能正确检测环境。

    所以,在config/environment.rb 的顶部,我设置了ENV["RAILS_ENV"] ||= ENV["RACK_ENV"],这很好用。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-31
    • 2012-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 2012-01-10
    相关资源
    最近更新 更多