I am newbie into heroku. I was trying to deploy a Django application to heroku by following steps.

  1. Installed vartualenv
  2. Installed Django gunicron via pip
  3. Installed heroku toolbelt
  4. Created an empty git
  5. git add .
  6. git commit -m "First commit"
  7. ssh-keygen
  8. heroku create
  9. heroku keys:add
  10. git push heroku master

And the a error

(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.

I have follow every steps from heroku help site.

Please help me to fix this error

I have Ubuntu 13.4 64bit os

Update: here is the result of git remote -v:

$git remote -v
heroku git@heroku.com:infinite-mesa-xxx.git (fetch)
heroku git@heroku.com:infinite-mesa-xxx.git (push)

有帮助吗?

解决方案 2

Ok, i just solved the problem, This problem is with adding ssh key. So the correct commands for heroku deploying is

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

Because my ssh never knew which key to use it somehow have heroku the wrong information and that's why heroku was denying.

其他提示

Try running git remote -v. Does it give you more than one remote, like this?

your_app_name git@heroku.com:your_app_name.git (fetch)
your_app_name git@heroku.com:your_app_name.git (push)

If the remote depot is named something other than 'heroku' you will need to specify the push to that site instead. For example, if your remote is named ossko, try something like

git push ossko master

Often you will have different names for remote depots if you have more than one heroku app - you can use a different name for each app.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top