3

I'm having a problem re-installing homebrew. I am running Mavericks

It started with me trying to install express.js. Homebrew had been installed on my mac for quite some time, never had any trouble with it. I used sudo npm install -g express, but when I ran express --version, I got command not found. Eventually, I found a possible solution online, and just tried to reinstall npm with brew remove npm and brew install npm. Again, I ran into errors (Unfortunately, I didn't save the exact errors) I used brew doctor to try and figure it out, looked up a ton of tutorials and mucked around with homebrew, and I guess I broke something.

Now, I figure I should just try and reinstall homebrew.

I run the install command for homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

It returns this message:

It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again: rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

So, I run

rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

This returns:

-bash: brew: command not found

I try running the install command again, and this time, it doesn't tell me homebrew is already installed.

So again, I run the install command for homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And now I get this:

==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew Password: ==> Downloading and installing Homebrew... remote: Counting objects: 136, done. remote: Total 136 (delta 0), reused 0 (delta 0) Receiving objects: 100% (136/136), 10.37 MiB | 1.53 MiB/s, done. Resolving deltas: 100% (44/44), done. From https://github.com/Onomanatee/portfolio_Yuri_Legiest * [new branch] master -> origin/master HEAD is now at c253261 Commit4 ==> Installation successful! ==> Next steps Run brew doctor before you install anything Run brew help to get started

Running brew doctor or brew help , however, results in

-bash: brew: command not found

I really don't know how to fix this. And why is the brew installer referring to a repository I used as a test for a little web project? (right above Installation succesful!)

2
  • What does the command which brew output on your Mac after you run the cleanup command of "rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup"?
    – bmike
    Commented Oct 15, 2014 at 16:11
  • -bash: brew: command not found
    – Onomanatee
    Commented Oct 16, 2014 at 17:09

1 Answer 1

1

Short term answer, try this command to see if your brew installation worked:

/usr/local/bin/brew doctor

It seems that your bash environment may not be looking in the /usr/local/bin for executibles (which means you have to write the full path rather than just the name of the command). The solution may be just resourcing your conf files, which can be roughly done by closing your terminal and opening a new one. Otherwise, you'll want to add a line to your ~/.bash_profile. I think resourcing will do the trick though.

So after confirming the success with the first doctor, try quitting your terminal application and starting fresh, then your original usage of brew should work. If it doesn't try:

echo $PATH

and report back the results.

1
  • Unfortunately, /usr/local/bin/brew doctor doesn't seem to help. It just returns: -bash: /usr/local/bin/brew: No such file or directory. echo $PATH gives me this output: /Users/Sven/.rvm/gems/ruby-2.1.2/bin:/Users/Sven/.rvm/gems/ruby-2.1.2@global/bin:/Users/Sven/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin:/opt/local/bin:/usr/local/mysql/bin:/Users/Sven/.rvm/bin
    – Onomanatee
    Commented Oct 16, 2014 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .