Heroku comannd always fails

2019-08-30 23:46发布

问题:

I installed heroku-toolbelt.exe on Windows10. Whenever i enter "heroku" on the command prompt, it fails as below. I don't know what the prblrm is. Any help would be greatly appreciated.

noriko@NORIKO-VAIO C:\Users\noriko
> heroku --version
Installing Heroku Toolbelt v4... done.
For more information on Toolbelt v4: https://github.com/heroku/heroku-cli
Setting up node-v4.1.2... done
Updating plugins... done
Installing core plugins heroku-cli-addons, heroku-apps, heroku-fork, heroku-git, heroku-local, heroku-run...Error reading plugin heroku-status.         Reinstalling... done
 done
"\x80" on Windows-31J
C:/Program Files (x86)/Heroku/ruby-    1.9.3/lib/ruby/1.9.1/json/common.rb:148:in `encode'
C:/Program Files (x86)/Heroku/ruby-1.9.3/lib/ruby/1.9.1/json/common.rb:148:in `initialize'
C:/Program Files (x86)/Heroku/ruby-1.9.3/lib/ruby/1.9.1/json/common.rb:148:in `new'
C:/Program Files (x86)/Heroku/ruby-1.9.3/lib/ruby/1.9.1/json/common.rb:148:in `parse'
C:/Program Files (x86)/Heroku/lib/heroku/helpers.rb:218:in `json_decode'
C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:82:in `commands_info'
C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:77:in `commands'
C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:204:in `find_command'
C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:12:in `try_takeover'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:24:in `start'
C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'
Error:       "\x80" on Windows-31J (Encoding::InvalidByteSequenceError)
Command:     heroku --version
Version:     heroku/toolbelt/3.42.16 (i386-mingw32) ruby/1.9.3
More information in C:/Users/noriko/.heroku/error.log

回答1:

I resolved this by myself.
I edited last line of Heroku/bin/heroku.bat as follows.

from  
@ruby.exe "%~dpn0" %*  
to  
@ruby.exe -Eutf-8 "%~dpn0" %*