【问题标题】:Rails passenger server not running in production modeRails 乘客服务器未在生产模式下运行
【发布时间】:2013-12-09 20:06:21
【问题描述】:

我已将我的应用部署到生产服务器。但是我 thing 它没有在生产模式下运行。我这样说是因为它基于 config/environments/development.rb 中的设置发送邮件。这是我的 apache 配置...

#/etc/apache2/sites-available/default
<VirtualHost *:80>
   ServerName nso.server.com
   # !!! Be sure to point DocumentRoot to 'public'!
   DocumentRoot /home/name/nso/current/public
   RailsEnv production
   <Directory /home/name/nso/current/public>
      # This relaxes Apache security settings.
      AllowOverride all
      # MultiViews must be turned off.
      Options -MultiViews
   </Directory>
</VirtualHost>

此外,我正在使用 capistrano 进行部署。所有 capistrano 的东西似乎都工作正常。我确实在 delpoy.rb 中有这一行

set :rails_env, "production"

我需要吗?我可以在我的服务器上运行什么命令来查看它是否真的在生产模式下运行?

【问题讨论】:

    标签: ruby-on-rails capistrano passenger


    【解决方案1】:

    来自How to tell if rails is in production?

    tail -f log/production.log
    

    或者插入这个

    <%= "Environment: #{RAILS_ENV}" %>
    

    进入视图

    【讨论】:

      猜你喜欢
      • 2014-11-09
      • 2015-06-30
      • 2011-11-17
      • 1970-01-01
      • 2016-03-12
      • 2012-10-11
      • 2015-04-30
      • 2021-03-27
      • 1970-01-01
      相关资源
      最近更新 更多