我目前正在使用 Pow作为我的 Rails 应用程序中的服务器,并且需要将环境从开发更改为生产。我已添加 RAILS_ENV = 'production'
到我的配置/环境文件并重新启动服务器;但是,日志仍在 log/development
中生成
最佳答案
你可以从Pow's FAQ找到答案:
Can I run my app in different rails environments through Pow?
Pow is intended for development use only, but if you just want to test how your app behaves with the settings for your different environments (e.g. production), you can run the following from your app directory.
echo export RAILS_ENV=production > .powenv && touch tmp/restart.txt
您可以从 Pow's user manual 获取有关 .powenv 的更多信息.
关于ruby-on-rails - 在 Rails 应用程序中使用 Pow 服务器时更改环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20589799/