title: Why can't I load Nokogiri?
body: <p>I installed Nokogiri without any issues by running:</p>
  
  <pre><code>$ sudo gem install nokogiri
  Building native extensions.  This could take a while...
  Successfully installed nokogiri-1.5.9
  1 gem installed
  Installing ri documentation for nokogiri-1.5.9...
  Installing RDoc documentation for nokogiri-1.5.9...
  </code></pre>
  
  <p>When I run nokogiri.rb:</p>
  
  <pre><code>#!/usr/bin/ruby -w
  
  require 'nokogiri'
  
  puts "Current directory is: #{ Dir.pwd }"
  Dir.chdir("/home/askar/xml_files1") do |dirname|
  
    puts "Now in: #{ Dir.pwd }"
    xml_files = Dir.glob("ShipmentRequest*.xml")
  
    if xml_files.empty?
      puts "#{ dirname } is empty."
    else
      xml_files.each do |file|
        doc = Nokogiri::XML(open(file))
        # ... do something with the doc ...
      end
    end
  end
  </code></pre>
  
  <p>I got the error:</p>
  
  <pre><code>$ ruby nokogiri.rb 
  /home/askar/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- nokogiri (LoadError)
    from /home/askar/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  </code></pre>
  
  <p>I'm using Ruby 1.9.3, but for some reason it refers to Ruby 1.9.1. Can this be the cause?</p>