Skip to content

Instantly share code, notes, and snippets.

@samrocketman
Last active December 27, 2015 00:28
Show Gist options
  • Save samrocketman/7237502 to your computer and use it in GitHub Desktop.
Save samrocketman/7237502 to your computer and use it in GitHub Desktop.
This is a guide for the recommended method of installing Ruby from source.

This is a guide for the recommended method of installing Ruby.

Learn more about Ruby.

Ruby 1.8.7

RHEL 6.4 currenly only supports ruby 1.8.7 in the repositories which has been completely dropped which is currently in security maintenance only. Therefore it's recommended to manage ruby outside of the yum package management and build completely from source.

Install libyaml from source

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar -xzf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make install

Install ruby 1.8.7 stable

git ls-remote https://github.com/ruby/ruby.git | grep heads
git clone --branch ruby_1_8_7 https://github.com/ruby/ruby.git
cd ruby
autoconf
./configure
make && make install

Ruby 1.9.3

Requires ruby 1.8.7 or higher to compile.

Install ruby 1.9.3 stable

git ls-remote origin | grep heads #choose your branch to check out
git reset --hard
git clean -xfdn #this runs a simulation of deletions
git clean -xfd
git checkout ruby_1_9_3
autoconf
./configure
make && make install

Ruby 2.0.0

Requires ruby 1.8.7 or higher to compile.

Install ruby 2.0.0 stable

git ls-remote origin | grep heads #choose your branch to check out
git reset --hard
git clean -xfdn #this runs a simulation of deletions
git clean -xfd
git checkout ruby_2_0_0
autoconf
./configure
make && make install

Note if upgrading from 1.9.3 for some reason bundler gem does not come included and the bundle command breaks. To resolve that, install it.

gem install bundler
gem install rake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment