我已将我的应用部署到生产服务器。但是我 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>
Additonally我正在使用capistrano进行部署。所有capistrano的东西似乎工作正常。我在delpoy.rb中有这一行
set :rails_env, "production"
我需要它吗?我可以在服务器上运行什么命令来查看它是否实际在生产模式下运行?
答案 0 :(得分:0)
来自How to tell if rails is in production?
tail -f log/production.log
或插入此
<%= "Environment: #{RAILS_ENV}" %>
进入视图