 <p>Say you have two versions of the gem <code>foo</code> installed:</p> <pre><code>$ gem list foo *** LOCAL GEMS *** foo (2.0.1, 2.0.0) </code></pre> <hr> <p>If you use only <code>require</code>, the newest version will be loaded by default:</p> <pre><code>require 'foo' # =&gt; true Foo::VERSION # =&gt; "2.0.1" </code></pre> <hr> <p>If you use <code>gem</code> before calling <code>require</code>, you can specify a different version to use:</p> <pre><code>gem 'foo', '2.0.0' # =&gt; true require 'foo' # =&gt; true Foo::VERSION # =&gt; "2.0.0" </code></pre> <hr> <p><strong>Note</strong>: using <code>gem</code> without subsequently calling <code>require</code> does not load the gem.</p> <pre><code>gem 'foo' # =&gt; true Foo::VERSION # =&gt; NameError: uninitialized constant Foo </code></pre>