Homebrew fails on MacOS Big Sur

南楼画角 提交于 2021-02-06 06:48:28

问题


I upgraded from Mohave to Big Sur and found that homebrew is not working any more. I installed the command line tools using the command

xcode-select --install

After I run brew list, I get the following error

~ 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)

I tried by deleting the folder /Library/Developer/CommandLineTools and installing the Command Line Tools for Xcode 12.3 beta but still I am getting the same error. Is there any way to make brew work?


回答1:


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

brew upgrade



回答2:


You should update brew;

brew update-reset



回答3:


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



回答4:


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..




回答5:


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

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




回答6:


You should update brew;

brew update-reset


来源:https://stackoverflow.com/questions/64821648/homebrew-fails-on-macos-big-sur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!