參考:https://jingyan.baidu.com/album/fec7a1e5ec30341190b4e7e5.html?picindex=3html
1.在打開的命令行工具中輸入以下語句:git
ruby -e "$(curl --insecure -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"github
2.輸入root密碼後會開始下載homebrew,若是此時網速不穩定可能會出現錯誤提示:curl: (35) Server aborted the SSL handshake。vim
此時須要執行卸載操做,輸入以下命令進行卸載:ruby
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"bash
卸載完成後再次嘗試安裝。curl
安裝成功後出現:工具
-bash: brew: command not foundurl
解決方法:參考http://blog.csdn.net/li396864285/article/details/52572163.net
1.sudo vim .bash_profile
2.添加 export PATH=/usr/local/bin:$PATH
3.保存退出後,生效配置便可,source .bash_profile
再次輸入brew就已經成功