I have installed ruby 1.9.3 using hombrew
brew install ruby
But default 1.8.7 is still used. How can I switch osx to use 1.9.3 as default ruby?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I suggest you take a look at rvm.
You can then set it as default with
rvm use 1.9.3 --defaultBut if you are happy with your homebrew install.
Then just change the precedence of directories in the
PATHHere is my /etc/paths
This is important generally for homebrew, else the system version of git, ruby, pg_admin,… will all be used instead of the brew version.
if you say
which -a rubyyou’ll see all the installed rubies, and the precedence in thePATHeg.
UPDATE: I now don’t think you should change
/etc/pathsInstead you need to check which of
.profile,.bashrc, or.bash_loginis being loaded in your shell, and just add/usr/local/binto your path.For me, I only have a
.profile. You can create that file if none of those files already exist in your home directory.