brew: Brew cannot find /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

When I type any brew command I get this output.

> brew /usr/local/bin/brew: /usr/local/Homebrew/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 21: /usr/local/Homebrew/Library/brew.rb: Undefined error: 0

A couple days ago, I had an update to Xcode 8. Afterward, I saw that I had the update bug (took me a while to notice it) and was able to fix it with the procedure given on the main page.

Before that I had my homebrew and brews up-to-date. Could any of these changes caused the bug?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

If that fails try cd /usr/local Homebrew; git fetch origin; git reset --hard origin/master.

Looks like you’ve ended up in an older version of Homebrew. Can you try this:

cd /usr/local/Homebrew
git fetch origin
git checkout 1.0.1