MacOS Big Sur 自制程序失败

我从 Mohave 升级到大苏尔,发现自制程序已经不管用了。我使用以下命令安装了命令行工具

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,但我仍然得到相同的错误。有办法让啤酒起作用吗?

91399 次浏览

I had the same problem. Try upgrading brew - this solved it for me.

brew upgrade

You should update brew;

brew update-reset

If you run brew upgrade still meet the error, maybe you should run brew update first.

My experience is:

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

When I follow @andrmu instructions, I received an error stating Homebrew: Your CLT does not support macOS 11.0.. I had to first follow the instructions to clean upgrade my command line tools as per the top answer on this issue, then it worked..

After brew upgrade this did the trick to avoid tmp/mysql.sock error. Use commandline command:

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

You should update brew;

brew update-reset

I have solved my problem reinstalling brew with this script (install.sh):

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

Then:

brew --version

output:

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

Then just proceed with: xcode-select --install

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

This worked for me

After upgrading brew

brew upgrade

I got the following message:

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:

According to the instructions I ran the following commands:

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

and again ran

brew upgrade

And finally it worked.

I had the same problem, "brew update" wouldn't work, "brew upgrade" also didn't work, did the following:

brew update-reset

and then

brew upgrade

Now working fine.

Cheers,

H

I had MacOS Big Sur & nothing work for me even all answers of this question But Except one thing works with me:

brew update-reset