Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac - Can’t install Homebrew

I tried to install Homebrew like this:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

It didn’t install correctly so I closed Terminal and tried again. Now it displays me the following 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

I tried to do that but without success. The following message is displayed:

brew: command not found

So, the problem is that Homebrew is installed but actually it is not installed. Any suggestions how to solve this problem? Thank you!

like image 876
Cristiano Avatar asked Aug 04 '13 01:08

Cristiano


People also ask

Does Homebrew work on macOS Catalina?

macOS 11 (Big Sur) or higher is best and supported, 10.11 (El Capitan) – 10.15 (Catalina) are unsupported but may work and 10.10 (Yosemite) and older will not run Homebrew at all.

Where is Homebrew installed on Mac M1?

But if you install Homebrew on an M1 Mac running Apple Silicon, then Homebrew gets installed in /opt/homebrew/bin . Since /opt/homebrew/bin is not included in your PATH by default, there is some extra configuration needed to allow you to use packages installed with Homebrew.

Is Homebrew installed on Mac by default?

Implementation. Homebrew is written in the Ruby programming language and targets the version of Ruby that comes installed with the macOS operating system. By default, it is installed into /usr/local on Intel-based machines and /opt/homebrew on Apple silicon.


6 Answers

This seems to have resolved the issue for me

rm -rf /usr/local/Cellar /usr/local/.git
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Afterward, I can now

brew doctor

You may also find the gist linked to at the following page of use:

https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md

like image 63
iii Avatar answered Oct 19 '22 18:10

iii


The URL contained in the command you are using is not correct. Ruby will dump out lines of HTML and then fail. Use this command instead:

ruby -e "$(curl -fsSkL raw.github.com/Homebrew/homebrew/go/install)"

like image 29
ElephantHunter Avatar answered Oct 19 '22 19:10

ElephantHunter


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

this is work for me!

like image 30
Sinh Thái Avatar answered Oct 19 '22 17:10

Sinh Thái


This worked for me:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

like image 28
HasanAboShally Avatar answered Oct 19 '22 17:10

HasanAboShally


I removed the folder /usr/local/.git and homebrew installed just fine afterwards.

like image 31
atripes Avatar answered Oct 19 '22 18:10

atripes


What was the message given when it didn't install correctly the first time? Is the brew binary present in /usr/local/bin ? If so, you probably just need to add it to your path, see: Error Installing Homebrew - Brew Command Not Found

like image 39
DMR Avatar answered Oct 19 '22 19:10

DMR