Reputation: 427
I am trying to install brew in OS X El Capitan 10.11.3 but i got this error:
MacBook-Pro-de-paquirrin:~ paquirrin$ sudo 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>'
Upvotes: 1
Views: 110
Reputation: 56
The problem come from the owner of the directory /usr/local. Nothing more and the command sudo chown $(whoami):admin /usr/local is enough (without -R)
I had success following these instructions: https://github.com/Homebrew/legacy-homebrew/issues/49879
In summary these two commands:
sudo chown -R $(whoami):admin /usr/local
cd $(brew --prefix) && git fetch origin && git reset --hard origin/master
Should fix it.
Upvotes: 1