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- conflicts with file from package ruby-libs-1.8.5-5.el5_4.8.i386

How do I get ruby updated?

  • Just ran that. All it did was completely break ruby. It doesn't seem to fully erase it, just enough to break the version that was there. – user1337 Jun 8 '12 at 15:45
  • How do you know it break the older version? Please show us the output. – quanta Jun 8 '12 at 15:55
  • When I tried to install the new version, I still got conflict errors: file /usr/lib/ruby/1.8/yaml/types.rb from install of ruby-libs- conflicts with file from package ruby-libs-1.8.5-5.el5_4.8.i386 and # ruby -v -bash: /usr/bin/ruby: No such file or directory – user1337 Jun 8 '12 at 16:31
  • Which architecture are you running? 32-bit or 64-bit? If it is 64-bit, uninstall all the ruby-*.i386 packages and try again. – quanta Jun 8 '12 at 16:38

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.


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:


You probably need to remove the old 1.8 ruby first.

  • I installed as root. What directory do I need to be in when I run one of those install methods? – user1337 Jun 7 '12 at 17:40
  • The directory you're in wont' matter. The install path is set when you run configure with the right options. Anyway, this is not the best way to install ruby on a CentOS box. I'm updating my answer with what looks like a better way. – cjc Jun 7 '12 at 18:27
  • Thanks. I have no experience with RVM so I'll give the RPM a try. – user1337 Jun 7 '12 at 18:43
  • No luck. Same errors every time I get to the rpmbuild -bb ruby19.spec stage Could not open file /root/rpmbuild/BUILD/ruby-1.9.3-p194/doc/capi/html/d5/d6d/_8ext_2include_2x86__64-linux_2ruby_2config_8h-source.html for writing make: *** [doc/capi/.timestamp] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.54629 (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.54629 (%build) – user1337 Jun 7 '12 at 18:55
  • Hmm. How about this instead of just a spec file: rpmfind.net//linux/RPM/fedora/devel/rawhide/src/r/… Basically, download the referenced source RPM. You will get a .src.rpm file. You should be able to run rpmbuild -ba ruby- and wind up with the binary RPMs in /usr/src/redhat/RPMS somewhere. You can then run rpm -ihv against those RPM files. – cjc Jun 7 '12 at 19:17

I agree with cjc. Additionally to find where your new ruby binary is you should have luck with this: sudo updatedb locate bin/ruby

  • 1
    When I run that I get updatedb: unexpected operand on command line – user1337 Jun 7 '12 at 17:58
  • they are supposed to be separate commands: updatedb && locate bin/ruby – marcovtwout Dec 9 '15 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.