You can use the `directory` command for this: http://rake.rubyforge.org/doc/rakefile_rdoc.html#label-Directory+Tasks

This will guarantee that the directory exists for any task that declares it as a dependency.