无法推送到Heroku'致命:无法访问..无法解析主机:(无); 提供nodename或servname,或者不知道'

jth*_*ife 19 git github heroku

我在Heroku上有一些应用程序,没有任何问题,但我突然遇到运行git的问题.现在我无法将我的应用程序部署到Heroku.我跑的时候

git push heroku master
Run Code Online (Sandbox Code Playgroud)

我得到以下内容:

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

我跑的时候

git remote -v
Run Code Online (Sandbox Code Playgroud)

我得到以下内容:

heroku  https://git.heroku.com/<herokuappname>.git (fetch)
heroku  https://git.heroku.com/<herokuappname>.git (push)
Run Code Online (Sandbox Code Playgroud)

我查了一切.请帮忙,谢谢.

Rac*_* Uy 32

每当这个随机发生在我身上时,删除并再次添加heroku作为远程引用始终有效.

首先检查你是否有heroku作为遥控器.

git remote -v

如果存在heroku,请将其删除.

git remote rm heroku

然后加回来.

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

通常这适用于我,尝试它,让我知道会发生什么.

  • 对我来说没用,heroku git:remote -a <project_name>,取自http://stackoverflow.com/questions/5129598/how-to-link-a-folder-with-an-existing-heroku-app做了这个工作. (3认同)

Ser*_*gey 16

试试这个:

heroku keys:add
Run Code Online (Sandbox Code Playgroud)

为我工作


小智 5

git remote -v
git remote rm heroku
git remote add heroku git@heroku.com:project(full url).git
heroku keys:add
Run Code Online (Sandbox Code Playgroud)

这些步骤有效