Skip to content

Instantly share code, notes, and snippets.

@Leopere
Forked from samrocketman/how_to_ruby.md
Last active December 29, 2015 00:39
Show Gist options
  • Save Leopere/7587926 to your computer and use it in GitHub Desktop.
Save Leopere/7587926 to your computer and use it in GitHub Desktop.

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. 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_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

chamunks: This is how I compiled ruby... https://gist.github.com/sag47/7237502

chamunks: The instructions should apply to ubuntu. Just make sure you have build-essential, autoconf, and make packages installed.

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