get which enviornment is running from controller..

I'd like to know this also. I need to know how force a rake task to
pick up an environment other than 'production' on my production host.
I renamed my environment to something more specific, but "rake
db:migrate" always uses the configuration under the "production"
environment...

Ah, google actually had the answer to my question:
   rake db:migrate RAILS_ENV=my_production_env