MacOS – Homebrew installation failed on OS X El Capitan. Uninstall won’t work. How to start over and reinstall

homebrewinstallmacos

I'm trying to install Homebrew. Running OS X 10.11.1. When installing, I got an error message. I now can't retrieve the output I got, but there were several "fatal" errors.

When trying to reinstall Homebrew, I get the following:

It appears Homebrew is already installed. If your intent is to
reinstall you should do the following before running this installer
again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are include lib .git

And when I follow those instructions by running the script it recommends, I get:

-e:100:in `realpath': No such file or directory - /usr/local/bin (Errno::ENOENT)
    from -e:100:in `realpath'
    from -e:100:in `<main>'

So how in the world do I perform a clean uninstall and reinstall?

Best Answer

Late answer, but I just ran into this issue myself.

This Github issue suggests the solution is to run rm -rf /usr/local/.git. I did that, but the issue persisted. I then deleted the /usr/local/Homebrew directory. That seemed to resolve things for me, and I could then re-run the install command OK.