title: Force ruby to use dbi Gem instead of dbi in site_ruby
body: <p>I'm using:</p>
  
  <ul>
  <li>Windows 7</li>
  <li>Ruby 1.8.6 One-Click Installer</li>
  <li>DBI version 0.4.3 installed using RubyGems</li>
  </ul>
  
  <p>What I see when executing these commands:</p>
  
  <blockquote>
    <p>C:>ruby -v</p>
    
    <p>ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]</p>
    
    <p>C:>gem -v</p>
    
    <p>1.3.1</p>
    
    <p>C:>ruby -r rubygems -r dbi -e "puts DBI::VERSION"</p>
    
    <p>0.2.2</p>
    
    <p>C:>gem list dbi</p>
    
    <p>*** LOCAL GEMS ***</p>
    
    <p>dbi (0.4.3)</p>
    
    <p>C:>gem environment</p>
    
    <p>RubyGems Environment:</p>
    
    <ul>
    <li>RUBYGEMS VERSION: 1.3.1</li>
    <li>RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]</li>
    <li>INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.8</li>
    <li>RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe</li>
    <li>EXECUTABLE DIRECTORY: C:/Ruby/bin</li>
    <li>RUBYGEMS PLATFORMS:
    
    <ul>
    <li>ruby</li>
    <li>x86-mswin32-60</li>
    </ul></li>
    <li>GEM PATHS:
    
    <ul>
    <li>C:/Ruby/lib/ruby/gems/1.8</li>
    <li>C:/Users/sutch/.gem/ruby/1.8</li>
    </ul></li>
    <li>GEM CONFIGURATION:
    
    <ul>
    <li>:update_sources => true</li>
    <li>:verbose => true</li>
    <li>:benchmark => false</li>
    <li>:backtrace => false</li>
    <li>:bulk_threshold => 1000</li>
    </ul></li>
    <li>REMOTE SOURCES:
    
    <ul>
    <li><a href="http://gems.rubyforge.org/" rel="nofollow noreferrer">http://gems.rubyforge.org/</a></li>
    </ul></li>
    </ul>
  </blockquote>
  
  <p>Why do ruby scripts use the DBI installed in site_ruby rather than the DBI installed with RubyGems?</p>
  
  <hr>
  
  <h2>Update to respond to Luis Lavena's answer...</h2>
  
  <p>Here's what happened when I attempted what you suggest:</p>
  
  <blockquote>
    <p>C:>ruby -r rubygems -e "require 'rubygems'; puts DBI::VERSION"</p>
    
    <p>-e:1: uninitialized constant DBI (NameError)</p>
  </blockquote>
  
  <p>And when I updated to require DBI:</p>
  
  <blockquote>
    <p>C:>ruby -r rubygems -e "require 'rubygems' ; require 'dbi' ; puts DBI::VERSION"</p>
    
    <p>0.2.2</p>
  </blockquote>
  
  <p>Why wouldn't RubyGems override the built-in library?</p>