Blankman
Blankman

Reputation: 267320

How can I make sure my deployed app is not running in development mode?

How can I make sure my deployed app is not 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).

Upvotes: 1

Views: 343

Answers (2)

cfeduke
cfeduke

Reputation: 23236

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>

Upvotes: 2

Denis Hennessy
Denis Hennessy

Reputation: 7473

You could add this to one of your pages:

<%= Rails.env %>

It will say "production" or "development"

Upvotes: 1

Related Questions