title: RUBY (Errno::ENOENT), no such file or directory @ dir_s_mkdir
body: <p>I'm following "The Bastards Book of Ruby" and I am trying to build a webscraper using nokogiri but about a quarter of the way into it when I attempt to run the code it throws the error:</p>
  
  <pre><code>Crawler.rb:6:in `mkdir': No such file or directory @ dir_s_mkdir - data-hold/nobel (Errno::ENOENT)
  from Crawler.rb:6:in `&lt;main&gt;'
  </code></pre>
  
  <p>My code is as follows:</p>
  
  <pre><code>require 'rubygems'
  require 'nokogiri'
  require 'open-uri'
  
  DATA_DIR = "data-hold/nobel"
  Dir.mkdir(DATA_DIR) unless File.exists?(DATA_DIR)
  
  BASE_WIKIPEDIA_URL = "http://en.wikipedia.org"
  LIST_URL = "#{BASE_WIKIPEDIA_URL}/wiki/List_of_Nobel_laureates"
  
  HEADERS_HASH = {"User-Agent" =&gt; "Ruby/#{RUBY_VERSION}"}
  
  page = Nokogiri::HTML(open(LIST_URL))
  rows = page.css('div.mw-content-ltr table.wikitable tr')
  
  rows[1..-2].each do |row|
  
    hrefs = row.css("td a").map{ |a| 
      a['href'] if a['href'] =~ /^\/wiki\// 
    }.compact.uniq
  
    hrefs.each do |href|
      remote_url = BASE_WIKIPEDIA_URL + href
      local_fname = "#{DATA_DIR}/#{File.basename(href)}.html"
      unless File.exists?(local_fname)
        puts "Fetching #{remote_url}..."
        begin
          wiki_content = open(remote_url, HEADERS_HASH).read
        rescue Exception=&gt;e
          puts "Error: #{e}"
          sleep 5
        else
          File.open(local_fname, 'w'){|file| file.write(wiki_content)}
          puts "\t...Success, saved to #{local_fname}"
        ensure
          sleep 1.0 + rand
        end  # done: begin/rescue
      end # done: unless File.exists?
  
    end # done: hrefs.each
  end # done: rows.each
  </code></pre>
  
  <p>I have literally no idea why it is not creating a new directory to store the data in.  I know I must be missing something extremely simple...</p>