开发者

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

开发者 https://www.devze.com 2023-01-28 15:42 出处:网络
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

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"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号