Skip to content

Instantly share code, notes, and snippets.

@montyanderson
Last active August 29, 2015 14:17
Show Gist options
  • Save montyanderson/99410160fbde250f23ed to your computer and use it in GitHub Desktop.
Save montyanderson/99410160fbde250f23ed to your computer and use it in GitHub Desktop.

Compiling Ruby on Debian or Ubuntu

1. Install all of the required dependencies.

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

2. Go to www.ruby-lang.org/en/downloads and download the latest stable version.

3. Assuming you've saved it into downloads, extract the tar archive.

$ cd ~/Downloads
$ tar xvfs ruby.tar.gz

4. Enter the directory and start the compilation process!

$ cd ruby
$ ./configure && make # This make take some time.

5. Move your compiled ruby binaries into the /usr/local directory, where they can be run globally.

$ sudo make install

6. For ruby gems to work as non-root, you must own the /usr/local directory. This should only be done if you are the main user planning on using gems.

$ sudo chown -R $USER /usr/local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment