Install Homebrew

Homebrew provides distribution and package management for common developer packages. It avoids using ad-hoc, developer-specific set ups and version conflicts. Almost everything you need to support java development, ruby and node.js is available.

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

    # Add the Homebrews binary path to the front of the $PATH
    echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
    source ~/.bash_profile

Check the installation with brew doctor.

brew doctor

When I originally installed homebrew I had errors because I use the mac as multiple users (one for work work, one for other work).

! brew install problem
    ! Configure brew to allow other users to write to Cellar      
    
    Larson-2:~ larson$ brew install postgresql
    Error: Cannot write to /usr/local/Cellar
    
    Larson-2:~ larson$ sudo brew install postgresql
    Cowardly refusing to `sudo brew install'

    Jeromys-MacBook-Pro:~ jeromyevans$ ls -ld /usr/local/Cellar
    drwxr-xr-x  8 jeromy  admin  272 22 Jun 21:13 /usr/local/Cellar
    sudo chmod -R g+w /usr/local/Cellar
    Jeromys-MacBook-Pro:~ jeromyevans$ brew install node
    Error: Permission denied - /Library/Caches/Homebrew/Formula/node.brewing
    sudo chmod -R g+w /Library/Caches/Homebrew
    sudo chmod -R g+w /usr/local/

Bring brew up to date. This may be need to be repeated from time to time.

brew update

And try it out by installing node.js

> brew install node   
    🍺  /usr/local/Cellar/node/0.10.29: 1547 files, 18