You'll need to change the permissions for /usr/local for your local user.
sudo chown -R
whoami /usr/local
The easiest way to get everything setup is to use Homebrew. To do this, you'll need to first install XCode from the standard XCode from Apple Developer site. Afterwards you can just install Homebrew though its normal installation
ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"