tags:

views:

4896

answers:

4

I am new to Ruby, so bear with me. I've been trying to update my Ruby to 1.8.7 and just ran into many issues on my Mac OS X (10.5.7).

So really, how do you update to Ruby 1.8.7?

Thanks.

+4  A: 

Have you tried the one click installer?

Charlie Martin
+1  A: 

Download and unpack the version of Ruby you want. We'll call the directory ruby_1.8.7 and assume it is in your home directory. Open a terminal window.

sudo cp -r ruby_1.8.7 /System/Library/Frameworks/Ruby.framework/Versions/1.8.7
cd /System/Library/Frameworks/Ruby.framework/Versions
sudo ln -sfh 1.8.7 Current
Rob Spieldenner
+5  A: 

The simplest answer is "don't". Ruby 1.8.7 was an attempt to create bridging release between 1.8 and 1.9, and the consensus of the community was that this was not necessary, so there was little support for it before 1.9 was finalized. The general recommendation is either to stick with 1.8 (the version is supplied with OS X 10.5), or use Ruby 1.9.

MacPorts has packages for Ruby 1.8.7 and Ruby 1.9, so that is probably the easiest way to get newer versions of Ruby without any risk of modifying OS X itself.

Stuart Ellis
+1 for MacPorts.
rampion
MacPorts makes it easy.
Chuck
probably not an issue for your mac, but there are security problems with 1.8.6 that were resolved in 1.8.7. If you want your dev box to be the same as production, you should upgrade both.
klochner
An additional note: Rails 3 beta requires Ruby 1.8.7 or greater. Thus, if you have certain gems that won't work with Ruby 1.9, you might also be required to use 1.8.7 over 1.8.6. Upgrading to Snow Leopard will also give you Ruby 1.8.7 if that is an option.
Kevin Sylvestre
A: 

necromancing...

http://rvm.beginrescueend.com/

ajhit406