Question

I have a Rails 4.1.1 app which is hosted on heroku. Recently I changed my heroku login credentials.

In the terminal if I run for example the line:

heroku run rake db:migrate

It will successfully complete the task. "which heroku" gives: /usr/local/heroku/bin/heroku

In my Rails app I have a deploy rake task which calls the same command through system

task :staging do  
  ...  
  system "heroku run rake db:migrate"
end

This however results in the error: Running 'rake db:migrate' attached to terminal... Authentication failure In this case "which heroku" gives: /usr/local/rvm/gems/ruby-2.1.1@amn/bin/heroku

It's worth noting my app has the gem pgbackups-archive which requires the heroku gem.

How can I force the heroku gem version Rails is using to use my new login credentials or is there another way to fix this.

Thanks

Was it helpful?

Solution

The issue turned out to be with the Heroku gem.

The Heroku gem uses the user account API rather than login details. Updating the API key resolved the Authentication issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top