SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to tell Terminal which version of Ruby to use as default?

    Hello,

    I have two questions that I was hoping someone could help out with.

    1. I recently installed Ruby 1.9.2 on my Mac (running Snow Leopard 10.6.4) and I havenít been able to figure out how to get Terminal to use the new Ruby as a default, rather than the factory-installed Ruby 1.8.7. The old Ruby 1.8.7 is located in my ~/usr/bin/ruby directory while the new Ruby 1.9.2 is in ~/usr/local/bin/ruby. Someone said that I need to put the new version of Ruby's directory in the PATH prior to the old version's directory so that the system looks there first - is this correct? If so, can anyone provide step by step instructions on how to do this?

    [Side Note: I actually somehow got it to work when I first installed 1.9.2, but I have networked computers and a wireless Apple Time Machine that is somehow communicating shell settings via the backup mechanism, from my un-upgraded MacBook back to the iMac that has the new 1.9.2 installed. Somehow the PATH settings from the MacBook seems to be overriding what's on the iMac. The same thing happens with my TextMate preferences - the style selections on the laptop get transferred to the one on the iMac in realtime somehow. After I figure out how to fix this, I'm going to change the settings on both machines to try and prevent this. Just curious if others have encountered this issue.]

    2. Iíve created a new directory but canít seem to figure out the correct way to add that directory to my PATH using the Terminal bash shell. I tried using the instructions that I found here (http://www.macgasm.net/2008/04/10/ad...thin-terminal/) twice but they didn't work for me. The directory containing my program ("Ruby_Programs") shows up in the PATH but when I try to run "ruby newprogram.rb" from the command line it results in ":ruby: No such file or directory -- newprogram.rb (LoadError)".

    Any help would be greatly appreciated. Here is my current PATH:

    $ echo $PATH
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/*******/src:/usr/X11/bin:/Users/*******/Ruby_Programs/:

  2. #2
    Team ********* Louis Simoneau's Avatar
    Join Date
    Sep 2009
    Location
    Melbourne, Australia
    Posts
    228
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This is always a bit of a mess. Fortunately, someone has gone to the trouble of creating an awesome Ruby Version Manager that lets you install as many versions of ruby as you want, set whichever one you want as the default, and switch between active versions with a single command. Behold: http://rvm.beginrescueend.com/

  3. #3
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestion.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •