How can I make sure my deployed app is not running in development mode?
How can I make sure my deployed app is no开发者_C百科t running in development mode?
I'm using capistrano for the first time so just a bit wary
I'm using ubuntu, nginx and passenger (ree).
If you are using Passenger then try
RailsEnv production
in your site's configuration. Your capistrano deploy.rb
should add a RAILS_ENV=production
to things like rake
commands (this is done by default).
(By default RailsEnv production should be used, but yours may say "RailsEnv development".)
By the above I mean in your vhosts.conf
or wherever your distro's Apache stores its site configurations.
For example:
<VirtualHost *:80>
ServerName blah.example.com
DocumentRoot /var/www/yourrailsapp/public
RailsEnv production
<Directory /var/www/yourrailsapp/public>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
You could add this to one of your pages:
<%= Rails.env %>
It will say "production" or "development"
精彩评论