Skip to content

Instantly share code, notes, and snippets.

@tamouse
Created November 2, 2014 22:35
Show Gist options
  • Save tamouse/16c86c471c61e7c1bcc7 to your computer and use it in GitHub Desktop.
Save tamouse/16c86c471c61e7c1bcc7 to your computer and use it in GitHub Desktop.
Install ruby from source on debian-based linux distros.
# as root:
apt-get update
apt-get install build-essential git-core curl bison openssl \
libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev \
libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev \
libcurl4-openssl-dev libopenssl-ruby apache2-prefork-dev libapr1-dev \
libaprutil1-dev libx11-dev libffi-dev tcl-dev tk-dev
cd /usr/src
# Note: exact version will vary, of course.
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.4.tar.gz
tar zxvf ruby-2.1.4.tar.gz
cd ruby-2.1.4
./configure --prefix=/usr # overwrite system installed ruby
make # compiles the source
make install # installs the programs in /usr/bin, etc
# check the install
cd
which ruby; ruby --version
which irb; irb --version
which gem; gem --version
which rake; rake --version
# install bundler
gem install bundler
@tamouse
Copy link
Author

tamouse commented Nov 2, 2014

This is if for some reason you don't want to use ruby-install, rvm, rbenv, or a distro package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment