1. 安装brew
cd /usr/local
sudo mkdir homebrew
curl -L https://github.com/mxcl/homebrew/tarball/master | sudo tar xz --strip 1 -C homebrew
cd homebrew/bin
./brew -v
file brew
cat brew | moresudo ./brew update
2. 将brew加入到path环境变量中
在".bash_profile"中更新路径配置
(如果~下没有文件".bash_profile" 请执行: touch '.bash_profile' )
vim '.bash_profile'加入
export PATH=$PATH:/usr/local/homebrew/bin
之后可以直接执行brew(不用./brew)