Broken directory creation on ruby 1.8.7

The Dir.exists? method doesn't exist in this version.