MacOSX
ver 10.12.1

Homebrewがおかしいことが発覚したので再インストールをするつもりでした。
brew updateが使えたのでHomebrewは入っているはずなのですが

brew install ほにゃらら 

すると、下記のエラーが出ます。

/usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `split': invalid byte sequence in UTF-8 (ArgumentError)
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `block in parse'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `each'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `flat_map'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `parse'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:8:in `initialize'
    from /usr/local/Homebrew/Library/Homebrew/utils.rb:310:in `new'
    from /usr/local/Homebrew/Library/Homebrew/utils.rb:310:in `which_all'
    from /usr/local/Homebrew/Library/Homebrew/gpg.rb:5:in `find_gpg'
    from /usr/local/Homebrew/Library/Homebrew/gpg.rb:20:in `gpg2'
    from /usr/local/Homebrew/Library/Homebrew/gpg.rb:23:in `<class:Gpg>'
    from /usr/local/Homebrew/Library/Homebrew/gpg.rb:3:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/requirements/gpg2_requirement.rb:2:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/requirements.rb:3:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/dependency_collector.rb:5:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/software_spec.rb:7:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/formula.rb:10:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/readall.rb:1:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/tap.rb:2:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/compat/tap.rb:1:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/compat.rb:2:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/global.rb:56:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/brew.rb:14:in `<main>'

ターミナルでrubyコマンドを打ってもずっと反応がないです。確実におかしいのですがどこで異常を確認できますか?
brewコマンドはbrew update以外doctorも含めて上記のエラーがでます。

この投稿はマルチポストです。
https://teratail.com/questions/78714

よろしくお願いします。