Switching Environments
Posted by Administrator on 24 December 2009 10:48 PM
Switching Environments

Rails can be run in different environments. Each will change the behaviour of your application in several ways, and can be used to help you with each
stage of the dev cycle. These environments are:

1. Development - In development, you are generally changing the code rapidly and reloading your application. You don’t need to restart the server or the application to see your changes. Rails error messages will be technically descriptive.

2. Test - testing

3. Production - In production, your code is expected not to change, so models and controllers are cached to run faster. That means no repeated trips to the database to ask about columns and types, resulting in a quicker loading application. Rails error messages are very concise and non technical.

By default, when you create a new application, it's set to 'development'.

To change it to production, just edit the environment.rb file in the config directory:

ENV['RAILS_ENV'] ||= 'production'

(708 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).