OS X El Capitan 版本 10.11.2
我尝试过 brew update
,但会显示此错误消息。
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/brew.rb:15:in `<main>'
我也尝试过
brew install zsh
,但会显示上述消息。请让我知道如何修复此错误消息。
最佳答案
在这里找到了对我有用的答案:https://stackoverflow.com/a/35495897/1354137
The problem mainly occurs after updating OS X to El Capitan (OS X 10.11). This is mainly because of file permission issues with file El Capitan’s new SIP process. Try changing permissions of /usr/local directory.
$ sudo chown -R $(whoami):admin /usr/local
If it still doesn't work, use following steps and everything will be fine. This may be because homebrew is not updated.
1. open terminal 2. $ cd /usr/local 3. $ git reset --hard 4. $ git clean -df 5. $ brew update
关于homebrew - 我无法使用 Homebrew 安装 zsh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35683771/