LoginSignup
6
7

More than 5 years have passed since last update.

HerokuにPushしようとしてはまったこと

Posted at

現象

$ git push heroku master

すると以下のエラーが出る。

ssh: connect to host gmail.com port 22: No route to host
fatal: The remote end hung up unexpectedly

ssh出来ないのが原因と思い、~/.ssh/configに以下を書いても解決せず。

Host heroku.com
  Hostname heroku.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  port 22

原因

  • デプロイしようとしているアプリを削除していた(古いアプリにリモートリポジトリにデプロイしようとしていた)

解決策

# リモートリポジトリを確認する(リモートリポジトリが古いものではないか?)
$ git remote -v

# 上記で古いリポジトリにPushしようとしていたら、それを削除する
$ git remote rm heroku

# 新しくaddする
$ git remote add heroku git@heroku.com:アプリ名.git
$ git push heroku master

参考

herokuを始めてつまったところメモ - x**3な人生

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7