SSHの鍵追加でAuthentication failureになったときの対処
heroku keys:add
でherokuに公開鍵を追加しようとした際、以下のようなエラーが発生。
GitBush
$ heroku keys:add
Found existing public key: C:/Users/ユーザ名/.ssh/id_rsa.pub
Uploading SSH public key C:/Users/ユーザ名/.ssh/id_rsa.pub... Authentication
failure
私の場合、直前にインストール・設定を行っていたheroku-accountsプラグインの動作とバッティングしていた模様。
ここを参考に、heroku-accountsプラグインをアンインストール。
GitBush
heroku plugins:uninstall heroku-accounts
rm -r ~/.heroku/accounts
heroku logout
heroku login
これで無事鍵追加できた。
'git_url' does not appear to be a git repositoryと出てpushできないときの対処
以下のようなエラーが出てpushできなかった。
GitBush
$ git push heroku master
fatal: 'git_url' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
'git_url'
がリポジトリじゃないよと言っているような気がする。
GitBush
$ heroku create templa
Creating name... done, stack is stack
web_url | git_url
Git remote heroku added
herokuアプリをcreateしたときに上記のようなメッセージが出ており、またGit管理フォルダ/.git/config
のリモートリポジトリの定義が
Git管理フォルダ/.git/config
[remote "heroku"]
url = git_url
fetch = +refs/heads/*:refs/remotes/heroku/*
となっていた。
Git管理フォルダ/.git/config
[remote "heroku"]
url = git@heroku.com:templa.git
fetch = +refs/heads/*:refs/remotes/heroku/*
上記のように書き換え再度pushしたところ、無事実行できた。
静的なファイルを置くだけのデプロイをしたい時
普通にpushすると以下のようなエラーが出てしまう。
静的なファイルのみの配置はサポートされていない模様?
GitBush
! Push rejected, no Cedar-supported app detected
そこで、index.phpを作成・コミットし、デプロイするファイルに含める。
そうするとpushを受け入れてくれるようになる。