Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby 2.2.0 install script for Ubuntu 14.04
#!/bin/sh
v=2.2
ruby="ruby-${v}.0"
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential libssl-dev zlib1g-dev
dst="$HOME/applications/ruby"
if [ ! -e "${dst}/src" ]; then
mkdir -p "${dst}/src"
fi
cd "${dst}/src"
if [ ! -e "${ruby}.tar.gz/src" ]; then
wget http://cache.ruby-lang.org/pub/ruby/${v}/${ruby}.tar.gz
fi
if [ -e "${ruby}" ]; then
rm -fr ${ruby}
fi
tar xf ${ruby}.tar.gz
cd ${ruby}
./configure --prefix=${dst}/${ruby} --enable-shared
make && make install
cd "${dst}"
if [ -e ruby ]; then
rm ruby
fi
ln -s ${ruby} ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment