class ActiveSupport::Cache::FileStore
def delete_empty_directories(dir)
def delete_empty_directories(dir) return if File.realpath(dir) == File.realpath(cache_path) if Dir.children(dir).empty? Dir.delete(dir) rescue nil delete_empty_directories(File.dirname(dir)) end end