RAILS_ENV

In Ruby on Rails you have always 3 environments.

  1. development
  2. test
  3. production
by default you are working in “development” environment. You can control the environments by setting the “RAILS_ENV” as a system variable in your operating system. Under Linux or Mac OS X you can enforce the environment by adding this variable to you “/etc/bashrc” file.
export RAILS_ENV="test"
On the production Server it should look like this:
export RAILS_ENV="production"
Another way to enforce the ruby environment is to set the Variable directly in the “environment.rb” file in you ruby on rails app. Like this:
ENV['RAILS_ENV'] = 'development'
This worked for me pretty good.

Published by Robert Reiz

CEO @ VersionEye. Passionated software developer since 1998.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: