Homebrew(mac):重新安装失败

Homebrew(mac):重新安装失败

好吧,我在使用 homebrew 时遇到了问题,当我使用任何 brew 命令时都会出错,所以我决定重新安装 homebrew。我使用了互联网上最标准的卸载命令。在检查 brew 命令未被控制台识别后,我再次安装了 homebrew。

事情是这样的。

localhost:~ ~~~~~~~~$ ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
remote: Counting objects: 199994, done.
remote: Compressing objects: 100% (54010/54010), done.
remote: Total 199994 (delta 144802), reused 199994 (delta 144802)
Receiving objects: 100% (199994/199994), 41.97 MiB | 187.00 KiB/s, done.
Resolving deltas: 100% (144802/144802), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
HEAD is now at 5057268 ledger: update 3.0.3_1 bottle.
-e:196:in `split': invalid byte sequence in UTF-8 (ArgumentError)
    from -e:196:in `<main>'

当我执行“brew”时,它显示的就是这个。

localhost:~ ~~~~~~~~$ brew
/usr/local/Library/Homebrew/global.rb:105:in `split': invalid byte sequence in UTF-8 (ArgumentError)
from /usr/local/Library/Homebrew/global.rb:105:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/brew.rb:16:in `<main>'

如果你们能帮助我,那就太好了。谢谢。

答案1

我遇到了类似的问题,那是因为我萊本安装但尚未将路径添加到我的$PATH环境变量中。

如果你使用狂欢然后尝试以下操作:

  • 添加eval "$(rbenv init -)"到您的~/.bash_profile
  • 通过运行检查~/.rbenv/bin~/.rbenv/shims是否在你的$PATHecho $PATH

如果你使用鱼壳那么您需要以不同的方式加载 rbenv。将以下 3 行添加到您的~/.config/fish/fish.config文件中:

set PATH $HOME/.rbenv/bin $PATH
set PATH $HOME/.rbenv/shims $PATH
rbenv rehash >/dev/null ^&1

相关内容