Can I install gems with apt-get on Ubuntu?

Posted on Mar 14, 2023

Question

I am new to Ruby and just diving in. The Ruby tutorial says I should get the packaging system from here: http://rubyforge.org/frs/?group_id=126

I am on Ubuntu Linux. The page has a .tar and a .gem option for downloading. Which should I download?

Also, are gems exactly analogous to Java jars? And why do I need the gem packaging system if I can just download gems one by one as they are needed?

Answer

On Ubuntu 16.04 and Ubuntu 18.04, both sudo apt-get install rubygems and sudo apt-get install rubygems-integration failed for me. Instead, I had to do this:

sudo apt-get install ruby-dev