报错会如下:
/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
作者解释如下:
Mac OS X 10.10 (Yosemite) no longer ships with Ruby 1.8 (only 2.0). I have changed the brew.rb file to use the ‘Current’ directory found in the Ruby.Framework folder. Unless there is a specific reason to use 1.8, this should prevent the issue above when doing a OS upgrade.
我还以为重装homebrew或者升级ruby到2.0来解决,然而我没怎么看他们讨论来讨论去的,因为有人直接贴出了一个方法,我测试通过了,分享出来:
cd /usr/local/Library/
git branch –set-upstream-to=origin/master master
# on branch master
git pull
当然了,这个方法是从git里重新拉了一个brew出来,为什么这个方法快呢?你尝试下重新安装brew就知道了,他需要你去clear一些东西,那不如拉源代码回来来得方便
时间: 2024-12-05 18:17:02