LoginSignup
15

More than 5 years have passed since last update.

Windows環境でHeroku toolbeltがエラーになる場合の対処方法

Posted at

概要

Windows環境でHerokuをセットアップし、Herokuコマンドで何かとエラーに遭遇したときの解決方法を記録しておきます。

"\x80" on Windows-31J (Encoding::InvalidByteSequenceError)

現象

Heroku toolbeltをインストールした後、何らかのHerokuコマンドを入力すると、自動的にHeroku Toolbelt v4のインストールが実行された後、

Error: "\x80" on Windows-31J (Encoding::InvalidByteSequenceError)
Command: heroku version
Version: heroku/toolbelt/3.42.16 (i386-mingw32) ruby/1.9.3
Error ID: 3710610a192a40a09aa1dea9caead6ff

のようなエラーメッセージで終了してしまう。

解決方法

  1. Heroku toolbeltをインストールしたフォルダ(デフォルトだと、Program Files¥Heroku)の中に、binフォルダがあるので、その中のheroku.batを見つけます。
  2. このファイルはこのままだと編集権限がないので、このファイルを右クリックしてプロパティを開き、セキュリティタブの編集ボタンを押します。
  3. Usersに対してフルコントロール権限を許可してOKボタンを2回押して保存します。
  4. メモ帳などで、heroku.batを開きます。
  5. 最後の方に、 @ruby.exe "%~dpn0" %* という記述があるので、ここを @ruby.exe -Eutf-8 "%~dpn0" %* に変更して保存します。

参考URL:http://stackoverflow.com/questions/33029991/heroku-comannd-always-fails

No such file or directory - "C:\Users\������ ������\AppData\Local/heroku/heroku-cli.exe"

現象

何度かHerokuコマンドを実行していると、 Updating Heroku CLI... done. という表示がされ、コマンドがバージョンアップされます。
このバージョンアップ後にHerokuコマンドを入力すると、

No such file or directory - "C:\Users\������ ������\AppData\Local/heroku/heroku-cli.exe" version

のようなエラーが出るようになってしまいます。

解決方法

C:¥ユーザー¥自分のユーザ名¥の直下に、.herokuというフォルダが作成されているので、このフォルダの中にあるclientというフォルダを削除します。autoupdate.lastという空のファイルは残しておくと、しばらくはコマンドラインのアップデートがされないようです。

参考URL:http://stackoverflow.com/questions/32808930/updating-to-heroku-toolbelt-v4-gets-access-denied-error

Do not authenticate with username and password using git.

現象

Herokuにデプロイをしようとすると、次のようにユーザ認証が入ってしまい、結果的に認証エラーとなってしまいます。

c:\Heroku\aitwilio>git push heroku master
Username for 'https://git.heroku.com':
Password for 'https://git.heroku.com':
remote: ! WARNING:
remote: ! Do not authenticate with username and password using git.
remote: ! Run heroku login to update your credentials, then retry the git command.
remote: ! See documentation for details: https://devcenter.heroku.com/articles/http-git#authentication
fatal: Authentication failed for 'https://git.heroku.com/アプリ名.git/'

解決方法

heroku auth:token
と入力して、続けて表示された文字列をコピーします。
同じようにgit push heroku masterとした時に、以下のように対応します。

Username for 'https://git.heroku.com': (空エンター)
Password for 'https://git.heroku.com': コピーした文字列

参考URL:http://stackoverflow.com/questions/27810419/git-push-heroku-master-is-still-asking-for-authentication


普段はMacユーザのため、Windowsで作業することはないのですが、たまたま勉強会用に資料を作っていてハマったので今後のために記録しておきます。
違っているところなどがあれば、ご指摘ください。

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