Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# This is a script to install both ruby 1.8.7 and 1.9.1, with suffixed binaries and aliased non-suffixed binaries
mkdir -p /usr/local/src ; cd /usr/local/src
tar -xjvf ruby-1.8.7-p72.tar.bz2
cd ruby-1.8.7-p72
./configure --prefix=/usr --program-suffix=18 --enable-shared
make && sudo make all install
cd /usr/local/src
tar -xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
sudo /usr/bin/ruby18 setup.rb
sudo /usr/bin/gem18 update --system
cd /usr/local/src
tar -xjvf ruby-1.9.1-p0.tar.bz2
cd ruby-1.9.1-p0
./configure --prefix=/usr --program-suffix=19 --enable-shared
make && sudo make all install
cd /usr/bin
binaries=( erb gem irb rdoc ri ruby testrb )
for binary in ${binaries[@]}; do
sudo mv ${binary}{,~} # Just in case
sudo ln -s $(pwd)/${binary}19 $(pwd)/${binary}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment