Installing ruby gems in your home directory

I found it hard to find good instructions for installing ruby gems as a non-root user without installing the gem package locally as well. Here’s what I figured out; hopefully this will save someone else some time in the future:

Related

One Response

For development you also have the option to build ruby and install it to your homedir. The gem command will install the gems wherever the ruby interpreter that runs it is installed.

At least for me personally that has helped when I run multiple versions of ruby in development but use RPMs to lay down everything system wide. Whenever I want to use a particular ruby version for development I just set my PATH appropriately.