ruby-on-rails - 在 Rails 应用程序中使用 Pow 服务器时更改环境

标签 ruby-on-rails ruby-on-rails-3

我目前正在使用 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/

相关文章:

ruby-on-rails - 如何在 Ruby 中使用 JSON 数据?

ruby-on-rails - 用户帐户设计和安全

ruby-on-rails - 如果在 Rails 中选中复选框,则在表单提交上设置一个值?

ruby-on-rails - 我需要将非数据库数据类创建为 Rails 3 "model",还是只是/lib 区域中的基本类?

mysql - 无法在 fedora 21 机器上安装 scrypt gem

ruby-on-rails - 如何加快为 rspec 测试创建 5,000 条记录的速度?

ruby-on-rails-3 - 如何覆盖rails中关系的默认has_many条件?

javascript - Rails Select Tag - 将参数传递给 Controller

ruby-on-rails - 允许使用咆哮或终端通知程序进行 guard

ruby-on-rails - Rails 在 application.rb 之前的每个请求之前运行代码