Skip to content

Instantly share code, notes, and snippets.

@ingeniarius
Created July 10, 2012 09:28
Show Gist options
  • Save ingeniarius/3082285 to your computer and use it in GitHub Desktop.
Save ingeniarius/3082285 to your computer and use it in GitHub Desktop.
Install Ruby 1.9.x on Ubuntu from sources
echo "Install Ruby..."
sudo apt-get update
sudo apt-get install build-essential libssl-dev zlib1g-dev libreadline-dev
export ruby_version=1.9.3-p194
cd /usr/src
sudo wget "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$ruby_version.tar.bz2"
sudo tar xf "./ruby-$ruby_version.tar.bz2"
sudo rm "./ruby-$ruby_version.tar.bz2"
cd "./ruby-$ruby_version"
sudo ./configure
sudo make
sudo make install
echo "RUBYOPT=-Ku" | sudo tee -a /etc/environment
sudo tee -a /etc/gemrc <<EOF
---
gem: --no-rdoc --no-ri
EOF
ln -s /etc/gemrc ~/.gemrc
echo "Ruby installed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment