title: Ruby Dir.exists? undefined method
body: <p>I looked the <code>Dir.exists?</code> method up in the <a href="http://www.ruby-doc.org/core-2.0/Dir.html#method-c-exist-3F" rel="nofollow">documentation</a> and I believe I am using it correctly, yet at each call I am hit with this error: </p>
  
  <p><strong>undefined method `exists?' for Dir:Class (NoMethodError)</strong></p>
  
  <p>Am I overlooking something incredibly obvious? Below is the related code.</p>
  
  <pre><code>#!/usr/bin/ruby
  ARGV.each do |dir|          # Arguements are directory names.
      if !Dir.exists?(dir)
  #dosomething
  end
  end
  </code></pre>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Using <code>File.directory?</code> instead of <code>Dir.exists?</code> fixes my program, yet does not explain this error.</p>