Homebrew是一款Mac OS平臺(tái)下的軟件包管理工具,擁有安裝、卸載、更新、查看、搜索等很多實(shí)用的功能。最近做短視頻播放的App,開始時(shí)用了七牛的PLPlayer,而聞?wù)f基于FFMPEG的ijkplayer更熱門,于是想探索一下,然而第一步安裝homebrew就卡住了。
打開終端,輸入:
/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
安裝成功,問題又來了
command not find...
翻閱各種博客,說是環(huán)境變量Path中沒有路徑/usr/local/bin
sudo vim .bash_profile //1.打開.bash_profile
export PATH=/usr/local/bin:$PATH? 2.為PATH添加/usr/local/bin的路徑
source .bash_profile 3.更新配置后的環(huán)境變量
測(cè)試命令是否能行
brew -v,搞掂吃碗面,能用了····折騰