diff --git a/Library/Homebrew/cache_store.rb b/Library/Homebrew/cache_store.rb index fc95550c09..c86a4b8044 100644 --- a/Library/Homebrew/cache_store.rb +++ b/Library/Homebrew/cache_store.rb @@ -62,7 +62,10 @@ class CacheStoreDatabase # @return [DBM] db def db # DBM::WRCREAT: Creates the database if it does not already exist - @db ||= DBM.open(dbm_file_path, DATABASE_MODE, DBM::WRCREAT) + @db ||= begin + HOMEBREW_CACHE.mkpath + DBM.open(dbm_file_path, DATABASE_MODE, DBM::WRCREAT) + end end # Creates a CacheStoreDatabase