Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install Ruby 1.9 using Homebrew. I'm using Mac OS X Lion, so Ruby 1.8.7 is installed by default.

I've got Homebrew installed at /usr/local/bin/brew (well that's what it says if I run 'which brew')

It seems to be using the Ruby located in /usr/bin/ruby (again, from 'which ruby')

I've read tons of suggestions saying I should do something to the path variable; mine looks like this:


Where am I going wrong? Why is the Homebrew version of Ruby not being used?

share|improve this question
up vote 1 down vote accepted

Bash checks all folders in $PATH for the first one containing the application you're looking for.

In some file (~/.profile, ~/.bashrc, ~/.bash_profilewill be a line adding/usr/local/bin` to your $PATH. It will look like this:

export PATH=$PATH:/usr/local/bin

Change the order to

export PATH=/usr/local/bin:$PATH

Now, the operating system will look into /usr/local/bin/ and use ruby from homebrew instead the system's native one.

share|improve this answer
I didn't actually have a line like you specified, but I added PATH=/usr/local/bin:$PATH as the first line in ~/.profile and that fixed it! Thanks – Jaco Pretorius Nov 4 '11 at 0:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.