0

Possible Duplicate:
Heroku automatically changing RAILS_ENV and RACK_ENV variables to “production” on every deploy

I am currently trying to write a Rake script that will run the commands I need to do a deployment to my staging app, that will use asset_sync to copy over my assets to my cdn.

namespace :deploy do
 desc 'Deploy the app'
 task :staging do
  app = "app-name"
  remote = "git@heroku.com:#{app}.git"

  system "git push #{remote} master"
  system "heroku run rake assets:precompile --app #{app}"
end

end

However when I run this Heroku is overwriting my RAILS_ENV (amongst others) back to production.

Running Heroku releases afterwards

v143  Deploy 2b3aa3f                              10m ago
v142  Add RAILS_ENV, RACK_ENV, PATH, LANG, G..    10m ago

Any ideas why it might be doing this?

Many thanks

Phil

Community
  • 1
  • 1

1 Answers1

1

Another user is experiencing the same issue. Given you configured the variables, maybe an Heroku bug.

Try to open a ticket at Heroku.

If you haven't configured the variables yet, make sure to change Ruby environment RAILS_ENV and RACK_ENV to staging.

$ heroku config:add RAILS_ENV=staging
$ heroku config:add RACK_ENV=staging
Community
  • 1
  • 1
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364