LoginSignup
6
5

More than 5 years have passed since last update.

Heroku で Hello World するまでの手順&エラー対応

Posted at

WindowsでHeroku で deploy までの手順で、push master するときの
ssh公開鍵関連で手間がかかったので備忘録。

デプロイまでの手順の参考は以下。

mobage develover blog 初心者でも15分で公開できるHerokuのはじめかた

「7. アプリをデプロイ」までは問題なく実行できたあと、
git push heroku masterを実行した時に以下のエラーになった。

prompt>git push heroku master
The authenticity of host 'heroku.com (50.19.85.154)' can't be established.
RSA key fingerprint is XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,50.19.85.154' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

試した対応方法は以下。

  1. 鍵の環境設定 参考
    コマンドプロンプトで実行。鍵は認識していたので解消しなかった。

    set HOME=C:\Users\%USER%

  2. keyを初期化して再度追加。参考
    以下のコマンドを実行した。

    heroku keys:clear
    heroku keys:add (リストから公開鍵を選択)
    heroku keys (公開鍵を確認)

  3. configファイル編集 参考
    SSH_HOMEがどこかは要確認。(windows7_x64 pro で) C:\Users\%USER%\.ssh\config ファイルを設定。

    Host heroku.com
    User git
    port 22
    Hostname heroku.com
    IdentityFile ~/.ssh/heroku_rsa
    TCPKeepAlive yes
    IdentitiesOnly yes

上記の後、git push heroku master を実行すると、無事Hello world完了。

6
5
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
5