Installing HomeBrew on Mac¶
One of the best tools for installing software on a Mac is the HomeBrew system. HomeBrew is a Ruby based program that uses a “formula” to define how to download and install a large number of popular programs. HomeBrew will manage compiling many of these packages from source code, making sure that everything on your system is up to date and works well.
Installing¶
HomeBrew is a Ruby program, so we need a recent version of Ruby on the Mac. Fortunately, the default installation of Mac OS-X has Ruby installed:
ruby --verison
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
This command will install HomeBrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Setting the system path¶
HomeBrew installed packages as a normal user (it does not need sudo
for
most commands). All packages are installed under /usr/local/Cellar
(where
else would you keep your “brew”?), then linked into /usr/local/bin
. We
need to make sure the packages installed by HomeBrew are chosen before any
default versions installed on your system. To make this happen we need to add a
line to your .bash_profile
file in your home directory.
Note
This file is not present by default on the Mac. Just create it with a text editor.
export PATH="/usr/local/bin:$PATH"