LoginSignup
15
16

More than 5 years have passed since last update.

herokuで詰まったところいろいろ

Last updated at Posted at 2014-07-22

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プラグインの動作とバッティングしていた模様。

http://stackoverflow.com/questions/22957664/authentication-failure-in-heroku-cli-after-password-change

ここを参考に、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を受け入れてくれるようになる。

15
16
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
15
16