Skip to content

Instantly share code, notes, and snippets.

@hiro345
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiro345/300bcfeef8782dbb92e1 to your computer and use it in GitHub Desktop.
Save hiro345/300bcfeef8782dbb92e1 to your computer and use it in GitHub Desktop.
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