How to install Homebrew on OS X?

2019-01-16 02:40发布

I'm trying to install Homebrew on OS X.

According to the Homebrew site I should type

brew install wget

and all I get is

-bash: brew: command not found

So I've searched StackOverflow and found this answer. The problem, however, is I don't see brew in /usr/local/bin.

So, I also added the following line to my .bashrc file

export PATH=/usr/local/bin:$PATH

But I'm still getting the command not found error.

How do I get Homebrew installed on OS X?

9条回答
神经病院院长
2楼-- · 2019-01-16 03:07

On an out of the box MacOS High Sierra 10.13.6

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

Gives the following error:

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option.

If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL).

If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.

Solution: Just add a k to your Curl Options

$ ruby -e "$(curl -fsSLk https://raw.githubusercontent.com/Homebrew/install/master/install)"
查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-16 03:09

Check XCode is installed or not.

 $ gcc --version

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

 $ brew doctor

 $brew update.

http://techsharehub.blogspot.com/2013/08/brew-command-not-found.html "click here for exact instruction updates"

查看更多
霸刀☆藐视天下
4楼-- · 2019-01-16 03:16

I might be late to the party, but there is a cool website where you can search for the packages and it will list the necessary command to install the stuff. BrewInstall is the website.

However you can install wget with the following command:

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

Hope this helps :)

查看更多
登录 后发表回答