tags:

views:

71

answers:

2

I'm working on a project that i have to use ruby 1.8.7. I'm using today, ruby 1.8.6 + Mac OSX Darwin. This ruby 1.8.6 was installed with the OS, it's a developer package from Apple. My question is: how can i update this package? if i run ports, it dont find my current installed package and install a new ruby version, with different paths and as effect it breaks my rubygems (i know how to fix it, but it is always workarounds over workarounds).

There is a clean way to update the default ruby that comes with the OS or its better to remove it and just manage it by Port? Please answer like this one http://stackoverflow.com/questions/891120/how-to-update-to-ruby-1-8-7 don't helps me

+2  A: 

Have you tried rvm gem? It manages Ruby versions installed, allow to compile most (if not all) actual (and archival) Ruby versions, sets proper environment variables pointing to actually used ruby version.

$ gem install rvm
$ rvm install 1.8.7
$ rvm use 1.8.7 --default
MBO
i will try it, thanks!
VP
A: 

On my OS X machines I have several versions of Ruby installed.

I install then, from source, under /usr/local/ruby-1.X.X

Once you have multiple versions of Ruby installed you will need your environment to know which one to use.

I do this by setting the PATH, like so

export PATH="/usr/local/ruby-1.8.7/bin:$PATH";

See Hive Logic's article on installing Ruby

The Who