进入brew.sh主页,在最下方复制下面这句话,在终端运行 ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)",网上查到的那些地址大部分过期了,
所以还是直接到官方主页去找最新的地址比较靠谱。
Aces-MacBook-Pro:~ aishuang$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
==> 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/mkdir /Library/Caches/Homebrew
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
提示 安装Command Line Developer Tools,确定安装完后,回到终端下一步
==> Installing the Command Line Tools (expect a GUI popup):
==> /usr/bin/sudo /usr/bin/xcode-select --install
xcode-select: note: install requested for command line developer tools
等待下载homebrew,比较漫长
Press any key when the installation has completed.
==> Downloading and installing Homebrew...
remote: Counting objects: 171298, done.
remote: Compressing objects: 100% (47936/47936), done.
Receiving objects: 3% (6584/171298), 1.29 MiB | 9.00 KiB/s
Done
==> Downloading and installing Homebrew...
remote: Counting objects: 171298, done.
remote: Compressing objects: 100% (47936/47936), done.
remote: Total 171298 (delta 122278), reused 171233 (delta 122230)
Receiving objects: 100% (171298/171298), 33.17 MiB | 15.00 KiB/s, done.
Resolving deltas: 100% (122278/122278), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at cdec40e vim: use block-style inreplace
==> Installation successful!
==> Next steps
Run `brew doctor` before you install anything
Run `brew help` to get started
Aces-MacBook-Pro:~ aishuang$
接着
Aces-MacBook-Pro:~ aishuang$ cd /usr/local
Aces-MacBook-Pro:local aishuang$ ls
CODEOFCONDUCT.md Library bin
CONTRIBUTING.md README.md lib
LICENSE.txt SUPPORTERS.md share
Aces-MacBook-Pro:local aishuang$ mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 117 100 117 0 0 32 0 0:00:03 0:00:03 --:--:-- 32
100 132 100 132 0 0 32 0 0:00:04 0:00:04 --:--:-- 32
100 1152k 100 1152k 0 0 29304 0 0:00:40 0:00:40 --:--:-- 19174
Aces-MacBook-Pro:local aishuang$ export PATH=/usr/local/homebrew/bin:$PATH
Aces-MacBook-Pro:local aishuang$ brew -v
Homebrew 0.9.5
cmake
Aces-MacBook-Pro:~ aishuang$ brew install cmake
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.1
##### 7.9%