This is a simple process with all instructions for the Development Environment on Mac OS X.
All steps will be launch in your Terminal (/Applications/Utilities/Terminal)
.
If you don't already have XCode installed, it's best to first install the command line tools as these will be used by homebrew: