當沒有xcode時,咱們使用homebrew會提示出錯。xcode
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool工具
或者出現this
Error: The /usr/local directory is not writable.命令行
Even if this directory was writable when you installed Homebrew, othercode
software may change permissions on this directory. Some versions of thecomponent
"InstantOn" component of Airfoil are known to do this.homebrew
You should probably change the ownership and permissions of /usr/localip
back to your user account.開發
sudo chown -R $(whoami):admin /usr/localit
在某些狀況下,咱們須要使用mac的命令行工具(如homebrew),但不想安裝xcode開發環境。這時,咱們須要
更新xcode的開發連接路徑,使之指向實際的命令行工具路徑。
sudo xcode-select --switch /Library/Developer/CommandLineTools
這樣,homebrew就能找到環境了。