These set of scripts are for Magento 2. For Magento 1, see this Gist.
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: