Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

I have a few apps on Heroku, nothing has had this problem but I suddenly have had issues running git. Now I can't deploy my app to Heroku. When I run

git push heroku master

I get the following:

fatal: unable to access 'https://git.heroku.com/<herokuappname>.git/': Could not resolve host: (nil); nodename nor servname provided, or not known

When I run

git remote -v

I get the following:

heroku  https://git.heroku.com/<herokuappname>.git (fetch)
heroku  https://git.heroku.com/<herokuappname>.git (push)

I've looked up everything. Please help, thank you.

like image 658
jthedudeoflife Avatar asked Feb 21 '15 03:02

jthedudeoflife


3 Answers

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 [email protected]:project.git

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

like image 171
Rachelle Uy Avatar answered Sep 21 '22 14:09

Rachelle Uy


Try this:

heroku keys:add

Worked for me

like image 30
Sergey Avatar answered Sep 23 '22 14:09

Sergey


git remote -v
git remote rm heroku
git remote add heroku [email protected]:project(full url).git
heroku keys:add

These steps worked

like image 39
Christopher Govender Avatar answered Sep 21 '22 14:09

Christopher Govender