從 Mac App Store 免費下載安裝。
在 XCode 的 Preferences > Downloads 可以選擇安裝 command line tools。
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
前往 http://xquartz.macosforge.org/trac/wiki 尋找當前的穩定版本(stable),下載 dmg 並安裝(目前為 2.7.4)。
需要修改一下軟連結(Symbolic link):
ln -s /opt/X11 /usr/X11
brew list
上述指令會告訴你需要檢查什麼(=這系統上目前透過 home-brew 安裝了哪些程式),每一個都需要執行 brew remove it
再重新以 brew install it
安裝一次,如果移除後無法再次安裝,就嘗試 brew install it --use-gcc
。
Will tell you what you need to check. Try out everything one by one and when one doesn't work brew remove it
and then reinstall it. If the install doesn't work, try brew install it --use-gcc
to prevent llvm from getting in the way.
Things that gave me issues that I had to remove and install:
- macvim
- imagemagick
- ghostscript
You might need to install libxml2 and link it manually to make sure you don't get the wrong xml2-config if your path:
brew install libxml2
brew link libxml2
Run brew doctor
and fix anything it tells you.
You may also need to symlink gcc for certain ruby gems and other stuff like that:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
You are good to go.