Homebrew 在 MacOS Big Sur 上失败

Homebrew fails on MacOS Big Sur

我从 Mohave 升级到 Big Sur,发现自制软件不再工作了。我使用命令

安装了命令行工具
xcode-select --install

我运行brew list后,出现如下错误

~ brew list
Traceback (most recent call last):
    11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
    10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
     9: from /usr/local/Homebrew/Library/Homebrew/global.rb:37:in `<top (required)>'
     8: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     7: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
     6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>'
     5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>'
     4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'
     3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version'
     2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new'
     1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize'
/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)

我尝试删除文件夹 /Library/Developer/CommandLineTools 并安装 Command Line Tools for Xcode 12.3 beta 但我仍然遇到同样的错误。有什么方法可以让 brew 工作吗?

我遇到了同样的问题。尝试升级 brew - 这为我解决了问题。

brew upgrade

你应该更新 brew;

brew update-reset

如果您运行 brew upgrade仍然遇到错误,也许您应该先运行 brew update

我的经验是:

1. brew update
2. brew doctor
3. brew upgrade

当我按照@andrmu 的说明进行操作时,我收到一条错误消息 Homebrew: Your CLT does not support macOS 11.0.。我必须先按照 the top answer on this issue 的说明彻底升级我的命令行工具,然后它才起作用..

brew upgrade 之后,这起到了避免 tmp/mysql.sock 错误的作用。 使用命令行命令:

sudo chmod -R 0777 /usr/local/var/mysql/

你应该更新 brew;

brew update-reset

我已经解决了使用此脚本重新安装 brew 的问题 (install.sh):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

然后:

brew --version

输出:

Homebrew 3.0.1
Homebrew/homebrew-core (git revision 47e5d; last commit 2021-02-14)

然后继续:xcode-select --install

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

这对我有用

升级brew后

brew upgrade

我收到以下消息:

Your Command Line Tools (CLT) does not support macOS 11.
It is either outdated or was modified.
Please update your Command Line Tools (CLT) or delete it if no updates are 
available.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.

Error: An exception occurred within a child process:

我根据说明运行执行以下命令:

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

再一次运行

brew upgrade

终于成功了。

我遇到了同样的问题,“brew update”不起作用,“brew upgrade”也不起作用,做了以下操作:

brew update-reset

然后

brew upgrade

现在工作正常。

干杯,

H