Fix your PATH
Get rid of those aliases. Remove them from the
bash_profile. First of all, check your path.
/usr/local/bin should take precedence over
/usr/bin. If this isn't the case, something is wrong. Try if the following works, when you add this line to
Save it, open a new shell and run
which -a ruby
Now you should see that
/usr/local/bin/ruby is used, whereas
/usr/bin/ruby comes second (this is the default ruby 1.8.7 of OS X).
Alternative: Install RVM
For a better Ruby experience I would recommend you remove the Homebrew installation of Ruby altogether and install RVM, the Ruby Version Manager. Why? Because it allows you to switch between your locally installed Rubies and Gems.
git over Homebrew if you haven't already. Then:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
After the installation, add RVM to your
~/bash_profile by entering the following into a terminal:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
Finally, open a new Terminal window and check if RVM works:
type rvm | head -1
This should output "rvm is a function". You can then proceed to install Rubies:
rvm install 1.9.2
Note: For any further instruction type following in command line
This will give you comprehensive notes on what's and how's.
When this is done, you can set it as default:
rvm --default use 1.9.2