After searching for homebrew on the GitHub website and finding the corresponding homebrew, check out the installation documentation for the following links:
Https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Installation.md
The installation requires OS X 10.6 or more systems, and the Xcode command line tool is installed.
The installation path cannot have spaces. The official recommendation is to install under the/usr/local path.
Open the terminal of your Mac. Enter the path, and then execute the commands in the installation documentation.
Cd/usr/local
mkdir Homebrew
Curl-l https://github.com/homebrew/homebrew/tarball/master | tar xz--strip 1-c Homebrew
The above installation simply extracts homebrew to local, and you need to configure environment variables to use the Brew command, otherwise the terminal will prompt command not Found.
Configure the environment variables for your Mac for the first time, and turn around the internet to find the right way.
Open the terminal and create a new. bash_profile file in the ~/directory (if you already have this file on your computer, skip this step)
Touch ~/.bash_profile
Open the. Bash_profile
Open ~/.bash_profile
Configure path in the edit window that pops up
Export Path=/usr/local/homebrew/bin: $PATH
Then go back to the terminal input to make the file effective.
SOURCE ~/.bash_profile
At this point, the environment variable configuration is complete.
How does Mac install homebrew?