Make sure you have the latest version of XCode installed. Available from the AppStore.
Install the Xcode Command Line Tools:
xcode-select --install
Homebrew is the missing package manager for OSX. Download and install using the following command: