title: How do I require a specific version of a ruby gem?
body: <p>Specifically, the ruby-oci8 gem.  I have both 1.0.7 and 2.0.4 installed.  I want 1.0.7.</p>
  
  <p>I can just require oci8, but I don't get the version I want.</p>
  
  <pre><code>irb(main):001:0&gt; require 'oci8'
  =&gt; true
  irb(main):002:0&gt; OCI8::VERSION
  =&gt; "2.0.4"
  </code></pre>
  
  <p>I can require using the full path to the file, which works, but is not going to be portable:</p>
  
  <pre><code>irb(main):001:0&gt; require 'C:\Ruby\lib\ruby\gems\1.8\gems\ruby-oci8-1.0.7-x86-mswin32-60\lib\oci8'
  =&gt; true
  irb(main):002:0&gt; OCI8::VERSION
  =&gt; "1.0.7"
  </code></pre>
  
  <p>I can use the gem command to ask for the version I want, but it doesn't appear to actually load the library:</p>
  
  <pre><code>irb(main):001:0&gt; gem 'ruby-oci8', :lib=&gt;'oci8', :version=&gt;'=1.0.7'
  =&gt; true
  irb(main):002:0&gt; OCI8::VERSION
  NameError: uninitialized constant OCI8
      from (irb):2
  </code></pre>
  
  <p>I would definitely favor this last approach if would load the library, rather than just confirming that it's present on my system.  What am I missing?</p>