1

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?

9
  • stackoverflow.com/a/6835131/631612
    – quanta
    Jun 8, 2012 at 4:13
  • 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, 2012 at 15:45
  • How do you know it break the older version? Please show us the output.
    – quanta
    Jun 8, 2012 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-1.8.7.352-5.el5.x86_64 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, 2012 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, 2012 at 16:38

2 Answers 2

3

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.

7
  • I installed as root. What directory do I need to be in when I run one of those install methods?
    – user1337
    Jun 7, 2012 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, 2012 at 18:27
  • Thanks. I have no experience with RVM so I'll give the RPM a try.
    – user1337
    Jun 7, 2012 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, 2012 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-1.9.3.194-11.fc18.src.rpm 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, 2012 at 19:17
0

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .