我是heroku的新手。我试图通过以下步骤将Django应用程序部署到heroku。
错误
(venv)han@HEEL:~/Desktop/projects/ossko$ heroku keys:add
Found existing public key: /home/han/.ssh/id_rsa.pub
Uploading SSH public key /home/han/.ssh/id_rsa.pub... done
(venv)han@HEEL:~/Desktop/projects/ossko$ git push heroku master
ssh: connect to host heroku.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我已经关注了heroku帮助网站的每一步。
请帮我解决此错误
我有Ubuntu 13.4 64bit os
更新:这是git remote -v
的结果:
$ git remote -v
heroku git@heroku.com:invalid-mesa-xxx.git(fetch)
heroku git@heroku.com:invalid-mesa-xxx.git(推送)
答案 0 :(得分:0)
尝试运行git remote -v
。它会给你多个遥控器吗?
your_app_name git@heroku.com:your_app_name.git(fetch)
your_app_name git@heroku.com:your_app_name.git(推送)
如果远程软件仓库的名称不是“heroku”,则需要指定对该网站的推送。例如,如果您的遥控器名为ossko
,请尝试类似
git push ossko master
如果您有多个heroku应用程序,通常您将拥有不同的远程仓库名称 - 您可以为每个应用程序使用不同的名称。
答案 1 :(得分:0)
好的,我刚刚解决了问题,这个问题是添加ssh密钥。 因此,heroku部署的正确命令是
nihan@heel:~$ heroku login
Enter your Heroku credentials.
Email: debashis.dip@gmail.com
Password (typing will be hidden):
Authentication successful.
nihan@heel:~$ cd dev/flask-app
nihan@heel:~/dev/flask-app$ heroku keys:clear
Removing all SSH keys... done
nihan@heel:~/dev/flask-app$ heroku keys:add
Found existing public key: /home/nihan/.ssh/id_rsa.pub
Uploading SSH public key /home/nihan/.ssh/id_rsa.pub... done
nihan@heel:~/dev/flask-app$ ssh-add ~/.ssh/id_rsa <---- This was the missing key
Enter passphrase for /home/nihan/.ssh/id_rsa:
Identity added: /home/nihan/.ssh/id_rsa (/home/nihan/.ssh/id_rsa)
nihan@heel:~/dev/flask-app$ git push heroku master
因为我的ssh从来不知道使用哪个密钥,所以heroku有错误的信息,这就是heroku否认的原因。