Fix rails_env option in schedules

As ENV['RAILS_ENV'] has been deprecated in Rails 3
and remove in Rails 3.1. I have left ENV['RAILS_ENV'] for backward
compatibility