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

depassion
depassion used Ask the Experts™
on
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
/usr/bin/ruby

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

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


Comment
Watch Question

Do more with

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

http://rvm.beginrescueend.com/

Author

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

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

Commented:
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 http://www.nubyrubyrailstales.com/2010/03/macports-headaches-solved.html where I blogged about the problem.

Author

Commented:
trying to install rvm

112:~ rebel$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
  % 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 http://github.com/wayneeseguin/rvm.git
Getting pack list for http://github.com/wayneeseguin/rvm.git
bash: line 33: 17313 Segmentation fault      git clone "$url"
ERROR: Cloning from http://github.com/wayneeseguin/rvm.git 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