Hello,
Whatever I do (install, uninstall, doctor, update) I get this error:
Sirenia:$ brew update
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- mach (LoadError)
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in <top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /usr/local/Library/Homebrew/global.rb:3:inrequire'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
from /usr/local/Library/brew.rb:15:in `
Oh dear. It's never done that before... Does anyone know what's happened and how to get me brewing again?
Thanks.
Cheers,
Matt
Please always fill in the issue template as requested.
Does anyone know what's happened
No idea, sorry.
how to get me brewing again?
Try to run brew update-reset and then brew update again.
Ah, ok, sorry.
Same old error - I'll re-install Sierra I think.
Cheers,
Matt
@CaptainFatty You should also put your code in issues in fenced code blocks.
I'll re-install Sierra I think.
Closing, then.
I'm having this problem after upgrading to High Sierra. No command works at all.
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- mach (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/Library/Homebrew/global.rb:3:infrom /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/brew.rb:15:in `<main>'
@jwmapana Run brew update-reset if that works or otherwise uninstall and install Homebrew again.
It is also worth trying
sudo chown -R $(whoami) /usr/local/*
if brew update-reset doesn't do the trick.
I have the similar issue! brew anything won't work, just give me the error:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
@LingyanYin What does brew update-reset output?
@MikeMcQuaid Thanks for reaching out. It gave me the same output.
brew update-reset
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- mach (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in <top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/Library/Homebrew/global.rb:3:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/brew.rb:15:in `
@LingyanYin Try cd "$(brew --repo)"; git fetch; git reset --hard origin/master
@MikeMcQuaid Still the same error. I also tried to re-start my macbook and same error still occurred. I just upgrade my IOS to high seirra yesterday... Today when I tried to use homebrew, then it failed totally...
cd "$(brew --repo)"
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- mach (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/local/Library/Homebrew/global.rb:3:infrom /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Library/brew.rb:15:in `'
@LingyanYin Uninstall and reinstall Homebrew through https://github.com/homebrew/install.
Thanks. This is my last resort which everything installed through homebrew will be also re-installed, too.
@LingyanYin Ok, last thing to try: cd /usr/local; git fetch; git reset --hard origin/master
Thanks! I have fixed it! :) 馃憤
I'm having the exact same issue LingyanYin - do you recall what steps you took to fix it? Thanks!
Hi, there is no walk-around way to solve this. You have to remove and reinstall the homebrew totally (following the instructions through https://github.com/homebrew/install)... and all the stuff you installed through homebrew previously needs reinstalled, too... Hope it helps :)
Yes, that is what I wound up doing myself. Then, I just found this which may be the better way to go on High Sierra for other users:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The ruby trick fixed it for me in High Sierra 10.13.3, thank you Gr3g0!
Most helpful comment
Yes, that is what I wound up doing myself. Then, I just found this which may be the better way to go on High Sierra for other users:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"