Categories: ruby, nesta

Install Ruby 1.9.3 on CentOS 6.3

Out of the box, Ruby 1.8.7 is installed on Centos 6.3

This gent github.com/imeyer kindly posted the steps - they are repeated down below. Thank God someone posted this - I would have spent a lot of time figuring it out..

yum install -y rpm-build rpmdevtools readline-devel ncurses-devel rpmdev-setuptree \
  gdbm-devel tcl-devel openssl-devel db4-devel byacc libyaml-devel libffi-devel make

rpmdev-setuptree
cd ~/rpmbuild/SOURCES
RUBY_VER=ruby-1.9.3
RUBY_SUBVER=p484
wget http://ftp.ruby-lang.org/pub/ruby/1.9/${RUBY_VER}-${RUBY_SUBVER}.tar.gz
cd ~/rpmbuild/SPECS
wget https://raw.github.com/imeyer/${RUBY_VER}-rpm/master/ruby19.spec

rpmbuild -bb ruby19.spec

ARCH=`uname -m`
KERNEL_REL=`uname -r`
KERNEL_TMP=${KERNEL_REL%.$ARCH}
DISTRIB=${KERNEL_TMP##*.}

yum localinstall ~/rpmbuild/RPMS/${ARCH}/${RUBY_VER}${RUBY_SUBVER}-1.${DISTRIB}.${ARCH}.rpm

Here is where my rpm had a different name, else all was good:

find . -print | grep rpm

yum localinstall ./RPMS/x86_64/ruby-1.9.3p484-1.el6.x86_64.rpm

ruby --version

Now can finally resume setup of code-highlighter

sudo gem install rack-codehighlighter

Published on