fix bug in setting RAILS_ENV