Installing Ruby 2.1 on Ubuntu

Posted on: 19 May 2016 - By Richard Mountain

Recently I’ve had to setup several instances of GitLab for hosting personal git reposorities. The biggest issue with this is that it requires Ruby version 2.1, now normally install Ruby would be as simple of running.

sudo apt-get install ruby

However this will only install version 1.9 which doesn’t help us as GitLab only runs on Ruby version 2.1.

So first thing we you need todo is to add a new PPA which contains the various versions of Ruby including 2.1 which is what we are looking for. Run the following command to add the repo.

sudo apt-add-repository ppa:brightbox/ruby-ng

Then run the update command, followed by the install command for Ruby.

sudo apt-get update
sudo apt-get install ruby2.*

Change the * for which revision you want, in this instance it would be

sudo apt-get install ruby2.1

Then all you need to do is confirm that you’ve installed it by typing

ruby -v

Which if you’ve managed to install Ruby without issues will display the version of Ruby that you’ve just installed.