Dir.exists? doesn't exist in Ruby 1.8.7, so use File.exists? instead.