Centos – How to upgrade ruby on CentOS 5.3

centoscentos5ruby

I have a CentOS 5.3 machine which I want to run SASS. To do this, I need to update the version of Ruby on the system. I've tried multiple methods of doing this, but none have worked so far (including: How to update Ruby on CentOS 5.x & Install Ruby 1.9.3 with libyaml on CentOS)

After trying to update, when I run ruby -v and I'm still at 1.8.5. I've restarted Apache, the whole machine… to no avail. I was going to uninstall ruby but some of what I read said not to do that.

When I run those updates, there's no errors and everything seems to install fine. I did try this method How to setup Ruby and RubyGems on CentOS? which results in errors like file /usr/lib/ruby/1.8/yaml/types.rb from install of ruby-libs-1.8.7.352-5.el5.x86_64 conflicts with file from package ruby-libs-1.8.5-5.el5_4.8.i386

How do I get ruby updated?

Best Answer

If you've run make install following those instructions, you've most likely put the new ruby into /usr/local/ somewhere.

When you run ruby -v you're most likely hitting the default ruby, which is probably in the PATH ahead of your brand new ruby. Check echo $PATH to see what it says.

You may also consider using rvm to manage the different ruby version.

Update:

If you don't want to use rvm, you should at least use package management, and install ruby 1.9.3 as an rpm. There doesn't seem to be any good repositories for ruby (though I only really searched for a few minutes), but look at these instructions:

https://github.com/imeyer/ruby-1.9.3-rpm

You probably need to remove the old 1.8 ruby first.

Related Topic