fix a deprecation warning for upcoming rails 4 and create metadata directory if it does not exist