Question about using gem install

Hi,

I’m running Rocky Linux 8 and I’d like to install the following piece of software:

Githug is an interactive command-line game to learn Git. I’ve already tested it in a VM, and it’s nice.

According to the documentation, Githug is supposed to be installed like this:

# gem install githug

It depends on the rubygems package.

Now my question. I usually refrain from installing stuff without using DNF and properly built packages. Only it looks like this time there’s no package to be found for githug, not even in Fedora.

When I perform the install as root, I end up with a /usr/local/bin/githug binary, though I don’t know what other stuff gets install where when running gem install.

What’s your take on this ? Can I use gem install as root without having to fear breakage ?

You should be able to find out using:

bundle show --paths

from your Ruby app root directory (where Gemfile exists) most of your system packages will be in /var/lib/gems. I expect for your local one, it will end up in /usr/local/lib/gems or thereabouts.

I’ve been using Redmine for years and have had main system packages and local ones installed with Gem and it’s worked. It’s not best practice, so you can do it without any major adverse effects, but it’s generally not recommended installing them as root user. The same comes for when compiling packages etc. The only time it will make a big difference is if you have a system-wide Ruby installed, and another one somewhere else.