how to change ruby path from /usr/bin/ruby to /usr/local/bin/ruby

depassion used Ask the Experts™
reading around the various ruby install tutorials it's required to change path from /usr/bin/ruby to /usr/local/bin/ruby but i cant seem to be able to do it. Ultimately i want to install Ruby 1.9.2, should i uninstall 1.8.7 or what? i tried to install Ruby 1.9.2 with macports, the installation seemed to go ok, but i cant find the new version, i seem to be stuck with 1.8.7

iMac:~ rebel$ which ruby

rebel$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Java Developer
Top Expert 2010
i'd suggest using rvm


ok, but how does that solve my path problem? Or is that not relevant using RVM?
Mick BarryJava Developer
Top Expert 2010

"RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments"

RVM may do it, but there's another way as well.  What I learned the hard way is that MacPorts doesn't play all that well with Ruby, and I experienced exactly the issues that you are describing.

You can see how I handled it at where I blogged about the problem.


trying to install rvm

112:~ rebel$ bash < <( curl )
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
113   683  113   683    0     0    866      0 --:--:-- --:--:-- --:--:--  1592
Initialized empty Git repository in /Users/rebel/.rvm/src/rvm/.git/
got 05cdf1935b20ee3a4286e4c5fb31fc9832113273
walk 05cdf1935b20ee3a4286e4c5fb31fc9832113273
Getting alternates list for
Getting pack list for
bash: line 33: 17313 Segmentation fault      git clone "$url"
ERROR: Cloning from failed.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial