Tim B.
Tim B.

Reputation:

Rails 2.3.3 - Setting to production mode

How do I set the application to production mode?

Okay, this must be a no-brainer but I'm about to deploy my first Rails app and I've got everything setup properly: Ubuntu Hardy, Passenger, MySQL. However, it's still running in development mode. I've only been able to find documentation for older versions of Rails and want to make sure that I'm doing it right.

Thanks in advance.

Upvotes: 6

Views: 7710

Answers (3)

dylanfm
dylanfm

Reputation: 6345

You'll need to set the RackEnv instead of RailsEnv. Actually, I just do both (although I mightn't need to...?).

Example vhost for a Rails 2.3 app:

<VirtualHost *:80>

  ...
  RackEnv production
  RailsEnv production
  ...

</VirtualHost>

Upvotes: 7

btelles
btelles

Reputation: 5420

passenger by default runs everything in production mode unless you specify otherwise:

Passenger RailsEnv documentation

If you create a view that outputs RAILS_ENV, does it say 'development'?

  • If so, then you may have set the RAILS_ENV variable to 'development' somewhere in your environment.rb file.
  • If you're not seeing that, and are seeing other symptoms, then could you list the symptoms?

Upvotes: 2

Andy Gaskell
Andy Gaskell

Reputation: 31761

Based on the docs you can set RailEnv. By default Passenger runs in production mode so maybe you copied RailsEnv development into your config.

Upvotes: 0

Related Questions