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!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay