views:

29

answers:

1

How is the environment set in Rails 3.0?

In Rails 2.x, environment.rb contained a line setting RAILS_ENV to production. It was commented out in the generated file. To force a production environment, uncomment that line.

Rails 3.0 contains no such line in environment.rb, and RAILS_ENV is deprecated. Is there something missing, or is the environment set when the server is started (eg "start Mongrel_rails -e production ..."

I'm trying out Rails 3.0 on my deployment host and getting some odd behavior. Specifically, it seems to be trying to load the :development object from database.yml, and it seems to be ignoring the :groups => :development option in the gemfile. Consequently the app is trying to use Sqlite3 on the deployment server where it is not available.

A: 

The replacement is Rails.env

I set the environment in my server config.. thin.yml, mongrel_cluster.yml, or whatever server I am using.

When you are using Cap, how do you call "bundle install"? You should be using the --deployment flag when deploying to prod. It would be helpful to see your deploy.rb file.

cowboycoded