brew package can`t link
問題
有時候brew install [package]
之後執行brew doctor
自檢會出現not link
錯誤
~/ brew doctor
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
libevent
執行brew link
發現:
~/ brew link libevent
Linking /usr/local/Cellar/libevent/2.1.8...
Error: Could not symlink include/evdns.h
/usr/local/include is not writable.
這就要求我們改變一些系統資料夾的讀寫許可權,要根據自己資料夾的實際情況去寫
sudo chown -R usrname:admin /usr/local/
sudo chown -R usrname:admin /usr/include/
sudo chown -R usrname:admin /Library/...
其中usrname
在系統偏好設定——使用者與群組中查詢
再執行:
~/ brew link libevent
Linking /usr/local/Cellar/libevent/2.1.8... 817 symlinks created
問題解決。