0

I ran this in Terminal:

brew install libsndfile

Which gave this error:

/usr/local/bin/brew: /usr/local/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/Library/brew.rb: Undefined error: 0

So in Terminal, I ran steps 1-5 as suggested in this answer:

1. open terminal  
2. $ cd /usr/local/Library/Homebrew  
3. $ git reset --hard  
4. $ git clean -df
5. $ brew update

And this is a screenshot of the output:

enter image description here

How can I get the command brew install libsndfile to work?

luciano
  • 13,158
  • 36
  • 90
  • 130

1 Answers1

2

The same thing was asked in this GitHub issue. The cause of your problem is that you have a very old version of Homebrew installed that still relies on Ruby 1.8, which has been replaced by Ruby 2.0 in macOS 10.10.

If you check the issue, you'll find two slightly different solutions. The one that worked for the person who opened the original issue is running these command in a terminal:

cd /usr/local/Homebrew
git fetch origin
git reset --hard origin/master

Afterwards, you can run brew upgrade to update the installed packages (might take some time).

jdno
  • 4,104
  • 1
  • 22
  • 27