• Posts tagged "homebrew"

Blog Archives

osx升级到10.9以上homebrew不能用

想用homebrew装个maven结果

$ brew install maven
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 23: /usr/local/Library/brew.rb: Undefined error: 0

原因是系统升级后ruby的版本升级到到了2.0,而/usr/local/Library/brew.rb里写死了用1.8版本运行brew

#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
# encoding: UTF-8

在osx 10.10 Yosemite里尝试直接修改1.8为2.0结果don’t work!
在github里找到解决方法:

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

brew又可以用啦