Ruby 1.9.1 package for CentOS/RHEL4

June 10th, 2009 by Aaron

While I like CentOS/RHEL as a distro, it does tend to be out of date for a lot of packages; especially if that software isn’t considered fully stable. One package in particular is Ruby 1.9, which has many critical improvements (real threads!) compared to v1.8. After a lot of searching came up empty, I grabbed the RPM spec file from the OpenPKG project and ported it to CentOS/RHEL4.

Rather then providing the various binary packages, I’m just doing a src.rpm. Note that I enabled pthread support, which is likely to cause problems if you’re using the ruby-tcltk package on RHEL, so you may want to disable that in the %configure section.

ftp://sftp.mudynamics.com/pub/ruby1.9-1.9.1p129-3.src.rpm (SHA1: 31eea950044c972fd96bc46a7d5876c8616648f8)

Since there are a lot of incompatibilities between 1.9 and 1.8, this rpm does not replace the older ruby 1.8 package- the interpreter is installed as /usr/bin/ruby1.9 and all other directories/binaries are also versioned.

I haven’t tried yet, but you may be able to build this under CentOS/RHEL5 as well.

Anyways, you can build your binary rpm like so:
rpm -ivh ruby1.9-1.9.1p129-3.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bb ruby-1.9.1.spec --target=i686 # edit to taste

Posted in Ruby | Permalink | Trackback

5 Responses

  1. Zane

    Thanks so much for doing this… I gave it a shot on my CentOS 4.8 and I got an RPM build failure as follows. I am fairly new with troubleshooting rpm source builds etc. I assume I am just missing some packages or libraries on the system? The errors look like missing libraries in the source files.
    ——————-

    RPM build errors:
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/*tk.rb
    File not found: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tcltk.rb
    File not found: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tk
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tk*.rb
    File not found: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tkextlib
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/*/tcltklib.so
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/*/tkutil.so
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/*-tk.rb
    File not found: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tcltk.rb
    File not found: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tk
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tk*.rb
    File not found: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/tkextlib
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/*/tcltklib.so
    File not found by glob: /var/tmp/ruby1.9-1.9.1p129-3-root-root/usr/lib/ruby1.9/1.9.1/*/tkutil.so

  2. Aaron

    Zane,

    I didn’t have this problem on my development system, but I’d guess you’re missing the tk and tk-devel RPM’s on your build system which is preventing the ruby-tk bindings from building properly.

  3. uwe

    i’ll get the following error, any ideas:

    Processing files: ruby1.9-libs-1.9.1p243-3.i586
    error: File not found: /root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/lib/ruby1.9/1.9.1/json/pure
    Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.1asi8K
    + umask 022
    + cd /root/rpmbuild/BUILD
    + cd ruby-1.9.1-p243
    + DOCDIR=/root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/share/doc/ruby1.9-libs-1.9.1p243
    + export DOCDIR
    + rm -rf /root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/share/doc/ruby1.9-libs-1.9.1p243
    + /bin/mkdir -p /root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/share/doc/ruby1.9-libs-1.9.1p243
    + cp -pr README COPYING COPYING.ja ChangeLog GPL LEGAL LGPL /root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/share/doc/ruby1.9-libs-1.9.1p243
    + cp -pr README.ja /root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/share/doc/ruby1.9-libs-1.9.1p243
    + exit 0

    RPM build errors:
    File not found: /root/rpmbuild/BUILDROOT/ruby1.9-1.9.1p243-3.i386/usr/lib/ruby1.9/1.9.1/json/pure

  4. Aaron

    uwe,
    Hard for me to say… that’s not my RPM package you’re using.
    -Aaron

  5. Oleg Petrochenko

    Can’t download src.rpm file.
    Is this server alive?
    Is there is another place to get this file?

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.