Chetan Mittal
Chetan Mittal Dev - Blog


Chetan Mittal Dev - Blog


How to install older Rubies on Ubuntu 22.04 using RVM?

Install Ruby 2.7.6, 3.0.4 using OpenSSL1.1.1 on Ubuntu 22.04

Chetan Mittal's photo
Chetan Mittal
·Oct 2, 2022·

4 min read

How to install older Rubies on Ubuntu 22.04 using RVM?

Table of contents

  • Background
  • The same problem
  • Install older Rubies using RVM on Ubuntu 22.04
  • Update


I am a big Ubuntu fan and basically I am a Ubuntu convert from Macbook.

Infact, this machine I am writing this blog post from is Ubuntu 22.04 installed on a Macbook Pro 2012 (Intel core i5) model.


My journey with Unix and Linux started during my uni days in Melbourne studying Systems Software Engg. at RMIT University in 2000-2001. I got to experience machines running on Solaris, FreeBSD, and many other flavours of Unix. I got to experience hell a lot of many other techie things which I could never had experienced in India.

During my Bachelors studies in India I had only heard of Unix from my father as he was working for the largest Govt. owned telecom department called DOT (Department of Telecommunications), known as BSNL now, in those days. Though, I had played with computers in my early days but never had experienced them in a technical sense. It was usually designing school banners, playing games, etc.

I remember buying an old Compaq system from a newspaper ad for $100 AUD, in June 2002, and installing Redhat Linux on it for the first time just to learn Linux. During those days Linux installers were all text based with no GUI. I ended up building a simple text editor in C++ while learning Linux and Motif GUI framework on it. Motif GUI

It has been 19+ years of learning and using Linux. And, everyday there is some error, bug, something not working in Linux which made me switch to Macbook in 2006. First generation white polycarbonate MacBook, 2006

Oh man! That was some experience. Everyone in Ruby on Rails community was using Macbook and owning one made me a part of the tribe.

But that experience gradually faded into nightmare when I had to buy everything for macos, and in India macos software was expensive. I bought MS Office for macos for 10,000 INR (approx 120 USD) in 2007. Anyways, It has been 15+ years of using macos.

In 2019 my Macbook Pro stopped working as I upgraded my macos from High Sierra to Catalina. I think the upgrade just f**d up my machine. Eventually, I got it fixed at the Apple Service Center in Bengaluru for 18000 INR (approx 220 USD). I even got it upgraded to 10GB RAM. And the guy at service center asked me not to install any macos other than El Capitan on it. Hmm! But I installed High Sierra and kept using it for my day to day development work in Ruby on Rails and Javascript.

Things changed in 2021 when brew couldn't install software packages required to upgrade/install RVM (tool I use to install multiple versions of Ruby) on my Macbook Pro. So what to do? I installed Ubuntu 21.04 on it and continued with my development work.

The same problem

When Ubuntu started to give me the same RVM problem, of not installing older Rubies, then I just banged my head asking myself what now? Though it installed Ruby-3.1.2 easily. So, I thought sadly that now I have to just stick with Ruby 3.1.2? Is there any other way?

I was not interested in spending more than 1,35,000 INR (approx 1,660 USD) on buying myself a new basic Macbook. For the same price I can get myself built 5 x Linux Pro machines.

Screenshot from 2022-10-02 11-36-37.png

And voila, this post about installing older rubies from Dean came as the saviour.

Install older Rubies using RVM on Ubuntu 22.04

$ sudo apt install build-essential
$ cd ~/Downloads
$ wget
$ tar zxvf openssl-1.1.1g.tar.gz
$ cd openssl-1.1.1g
$ ./config --prefix=$HOME/.openssl/openssl-1.1.1g --openssldir=$HOME/.openssl/openssl-1.1.1g
$ make
$ make test # you might get a few tests failing but just ignore
$ make install
$ rm -rf ~/.openssl/openssl-1.1.1g/certs
$ ln -s /etc/ssl/certs ~/.openssl/openssl-1.1.1g/certs
$ cd ~
# let us install older rubies now by using RVM. Hurray!
$ rvm install ruby-3.0.4 --with-openssl-dir=$HOME/.openssl/openssl-1.1.1g

Also let RVM community know:-

Enjoy developing!

I am converting myself into more a FOSS guy. Use Linux.


Since I have migrated to ArchLinux based EndeavourOS from Ubuntu I havent faced this problem and all Rubies get installed easily on it using RVM (Ruby Version Manager). See the screenshot below:-


Share this