2017-05-24 103 views
0

我在終端運行這個:無法安裝BREW

brew install libsndfile 

這給了這個錯誤:

/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 

所以在終端,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 

這是一個輸出截圖:

enter image description here

我怎樣才能讓命令brew install libsndfile工作?

回答

1

GitHub issue中詢問過同樣的事情。你的問題的原因是你已經安裝了一個非常舊版本的Homebrew,它仍然依賴於Ruby 1.8,它已經在macOS 10.10中被Ruby 2.0取代。

如果您檢查問題,您會發現兩個稍有不同的解決方案。對於誰開的原來的問題是在終端運行這些命令的人員工作的一個:

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

之後,你可以運行brew upgrade更新已安裝的軟件包(可能需要一些時間)。