change Dir.exists? to Dir.exist? 

Dir.exists? is now deprecated see: http://batsov.com/articles/2014/02/05/a-list-of-deprecated-stuff-in-ruby/