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
如果“brew update”命令執(zhí)行出錯杆勇,請確保文件夾/usr/local的所有者權限是你本人而不是root:
sudo chown $USER /usr/localbrew updat
在".bash_profile"中更新路徑配置
(如果~下沒有文件".bash_profile" 請執(zhí)行: touch '.bash_profile' 露久,存在直接打開:open -e .bash_profile )
加入路徑:
export PATH=$PATH:/usr/local/homebrew/bin
保存:source .bash_profile
之后可以直接執(zhí)行brew(不用./brew)