Skip to content

Instantly share code, notes, and snippets.

@NiiMER
Last active June 27, 2016 09:42
Show Gist options
  • Save NiiMER/ea92f18c18c307f21d4b0f587724f257 to your computer and use it in GitHub Desktop.
Save NiiMER/ea92f18c18c307f21d4b0f587724f257 to your computer and use it in GitHub Desktop.
Upgrade ruby on ubuntu regarding the old stable version on apt-get
#!/bin/bash
tmp_dir="/tmp"
version="2.2.3"
minor_version="2.2"
ruby_version="ruby-$version"
echo "## Installing Ruby ##"
sudo apt-get install -y autoconf build-essential libreadline-dev libssl-dev libyaml-dev zlib1g-dev libffi-dev
mkdir -p "$tmp_dir"
cd "$tmp_dir"
wget "http://cache.ruby-lang.org/pub/ruby/$minor_version/$ruby_version.tar.gz"
tar -xvzf $ruby_version.tar.gz
cd $ruby_version
./configure --disable-install-doc
make --jobs `nproc`
sudo make install
cd ..
rm $ruby_version.tar.gz
rm -rf $ruby_version
echo "## Ruby has been installed ##"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment