DEV Community

Sascha Eggenberger
Sascha Eggenberger

Posted on • Originally published at saschaeggi.Medium

7

Fix Homebrew (Brew) on macOS 11 Big Sur

If you encounter issues with brew on macOS 11 Big Sur, than it has a high chance of being a similar issue that I ran into.

One of the many error messages regarding brew on macOS 11:

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)
Enter fullscreen mode Exit fullscreen mode

How to fix this?

Remove old xcode command line tools

sudo rm -rf /Library/Developer/CommandLineTools

Install new xcode command line tools

sudo xcode-select --install

Update brew

brew upgrade

Note: I had to run it twice

If you still get an error message try to reinstall brew via:

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

Test if brew works

brew doctor

Now brew should work just fine under macOS Big Sur!

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (2)

Collapse
 
lvwarren profile image
L Van Warren

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Collapse
 
omri_regev_f0daa3b475baf6 profile image
Omri Regev

Nice, worked like charm. Thanks

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs