Read more

Installing Ruby <= 2.3 on Ubuntu 20.04+

Tobias Kraze
October 08, 2020Software engineer at makandra GmbH

This is not a good solution when you also use a gem like pg or mysql, which also builds against OpenSSL. Upgrade your Ruby version or run your legacy app in a Docker container instead.

Installing old Rubies (<= 2.3) with a standard rbenv + ruby-build is no longer possible on Ubuntu 20.04. This is because those Rubies depend on OpenSSL 1.0 which is no longer shipped with current Ubuntus.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

We have forked ruby-build Show archive.org snapshot with a workaround that makes it compile and statically link the latest OpenSSL 1.0 version. This works on Ubuntu 20.04, as well as on Ubuntu 18.04.

To switch to our fork of ruby-build, update ruby-build like this

git -C ~/.rbenv/plugins/ruby-build remote add makandra https://github.com/makandra/ruby-build.git
git -C ~/.rbenv/plugins/ruby-build fetch makandra
git -C ~/.rbenv/plugins/ruby-build checkout makandra/local-openssl-for-old-rubies

At makandra, this comes preinstalled on new developer PCs.

Now "rbenv install 1.8.7-p375" etc. will use the workaround and hopefully just work.

Note: When you try to install a very current Ruby version, our fork might not know about it. In this case, see this card

Posted by Tobias Kraze to makandra dev (2020-10-08 10:38)