I\'m getting an error when I run brew
in the terminal:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core
After updating to El Capitan, /usr/local
has root:wheel
rights.
Change the rights back to the user using:
sudo chown -R $(whoami):admin /usr/local
and:
brew doctor && brew update
This helped me to get Homebrew working again.
First, open a terminal session and run:
cd /usr/local/
git status
to see if Homebrew is clean.
If it's dirty, run:
git reset --hard && git clean -df
then
brew doctor
brew update
If it's still broken, try this in your session:
sudo rm /System/Library/Frameworks/Ruby.framework/Versions/Current
sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8 /System/Library/Frameworks/Ruby.framework/Versions/Current
This will force Homebrew to use Ruby 1.8 from the system's installation.
This issue should be fixed in the newest version of Homebrew. Try reinstalling it, which is described on the Homebrew home page.
Uninstall homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Then reinstall
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Warning: This script will remove: /Library/Caches/Homebrew/ - thks benjaminsila
The problem mainly occurs after updating OS X to El Capitan (OS X 10.11) or macOS Sierra (macOS 10.12).
This is because of file permission issues with El Capitan’s or later macOS's new SIP process. Try changing the permissions for the /usr/local
directory:
$ sudo chown -R $(whoami):admin /usr/local
If it still doesn't work, use these steps inside a terminal session and everything will be fine:
cd /usr/local/Library/Homebrew
git reset --hard
git clean -df
brew update
This may be because homebrew is not updated.
In my case I just needed to remove Homebrew's executable using:
sudo rm -f `which brew`
Then reinstall Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"