Homebrew是一款Mac OS平臺(tái)下的軟件包管理工具,擁有安裝冀宴、卸載灭贷、更新、查看花鹅、搜索等很多實(shí)用的功能氧腰。最近做短視頻播放的App枫浙,開(kāi)始時(shí)用了七牛的PLPlayer,而聞?wù)f基于FFMPEG的ijkplayer更熱門古拴,于是想探索一下箩帚,然而第一步安裝homebrew就卡住了。
打開(kāi)終端黄痪,輸入:
/usr/bin/ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然而紧帕,終端一直報(bào)錯(cuò):
fatal: cannot copy '/Library/Developer/CommandLineTools/usr/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/usr/local/Homebrew/.git/hooks/fsmonitor-watchman.sample': Permission denied
Failed during: git init -q
最終
//確保目錄歸屬管理組
sudo chgrp -R admin /usr/local
//確保管理組可讀
sudo chmod -R g+w /usr/local
安裝成功,問(wèn)題又來(lái)了
command not find...
翻閱各種博客桅打,說(shuō)是環(huán)境變量Path中沒(méi)有路徑/usr/local/bin
sudo vim .bash_profile //1.打開(kāi).bash_profile
export PATH=/usr/local/bin:$PATH? 2.為PATH添加/usr/local/bin的路徑
source .bash_profile 3.更新配置后的環(huán)境變量
測(cè)試命令是否能行
brew -v是嗜,搞掂吃碗面,能用了····折騰