How to Use RubyGems

Failure in using RubyGems seems to be a common problem in #ruby-lang and the documentation is clearly lacking1. Let’s go through how you are supposed to load a gem called foobar. First of all, the rubygems library has to be loaded. This can be done in three ways:

All three ways are equivalent. Loading the rubygems library does two important things:

1 Yes, I or somebody else should do something about it.

2 Not recommended, since not everybody likes or uses RubyGems.