PDA

View Full Version : How to tell Terminal to use newly downloaded Ruby 1.9.2 instead of original 1.8.7?




SBR210
Sep 13, 2010, 04:24 AM
Hello-
I've already compiled and installed Ruby 1.9.2 but I don't know how to get the Terminal to use the new version instead of the factory installed 1.8.7 that came on my Snow Leopard machine. Can anyone help me out with the right commands to use to set the default?

Thanks.



Cromulent
Sep 13, 2010, 04:31 AM
Hello-
I've already compiled and installed Ruby 1.9.2 but I don't know how to get the Terminal to use the new version instead of the factory installed 1.8.7 that came on my Snow Leopard machine. Can anyone help me out with the right commands to use to set the default?

Thanks.

Put the path to the newly installed version of Ruby before the path to the old version of Ruby in your PATH.

SBR210
Sep 14, 2010, 02:42 AM
Put the path to the newly installed version of Ruby before the path to the old version of Ruby in your PATH.

Thanks very much. As a complete newbie, would you be able to tell me specifically how to do that? I also need to add another new directory I created for Ruby files to the PATH as well. I've been looking on google and tried using the instructions here (http://www.macgasm.net/2008/04/10/adding-a-new-location-to-your-path-variable-within-terminal/) twice but they didn't work for me. Thank again for the help, really appreciate it.

mdatwood
Sep 15, 2010, 10:21 PM
Get RVM (http://rvm.beginrescueend.com/). It's easy to setup and will manage multiple Ruby versions and allow you to switch between them with a simple CLI command.