Cannot push to Heroku 'fatal: unable to access..Could not resolve host: (nil); nodename nor servname provided, or not known' Cannot push to Heroku 'fatal: unable to access..Could not resolve host: (nil); nodename nor servname provided, or not known' heroku heroku

Cannot push to Heroku 'fatal: unable to access..Could not resolve host: (nil); nodename nor servname provided, or not known'


Whenever this randomly happens to me, removing and adding heroku again as a remote reference always works.

First check if you do have heroku as a remote.

git remote -v

If heroku is present, remove it.

git remote rm heroku

Then add it back.

git remote add heroku git@heroku.com:project.git

Usually this works with me, try it and let me know what happens.


Try this:

heroku keys:add

Worked for me


git remote -vgit remote rm herokugit remote add heroku git@heroku.com:project(full url).githeroku keys:add

These steps worked