Andrei Pall

Linux Software Engineering

Install Ruby from Source on Ubuntu

Sometimes compilation fails because of unmet system dependencies, or compilation succeeds but the new Ruby version exhibits weird failures at runtime. The following instructions are our recommendations for a sane build environment:

sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev

You can install Ruby from source. Download and unpack a tarball, then just do this:

./configure
make
sudo make install

By default, this will install Ruby into /usr/local. To change, pass the –prefix=DIR option to the ./configure script.