rails 3.2:无法在生产模式下运行

时间:2012-05-07 10:51:37

标签: ruby-on-rails ruby-on-rails-3 production-environment

在生产模式下运行应用程序时出现问题。我想将其设置为默认值,将其作为生产运行。

RAILS_ENV="production"

我在application.rb中添加了以上行但没有运气。 任何想法如何使它成为可能。当我将应用程序上传到heroku时,它仍然在开发中运行,因此我无法将数据库分开。

2 个答案:

答案 0 :(得分:1)

application.rb不是定义环境变量的最佳位置。在Heroku上,您可以使用heroku配置定义RAILS_ENV:add RAILS_ENV = production

答案 1 :(得分:0)

RAILS_ENV="production"添加到application.rb无济于事。入门时阅读Heroku documentation