Expire cache in rake issue

jazzy jazzy wrote:

Hi All,
I am trying to expire a fragment cache in rake. I know that the best
practice to expire the cache is in the Sweepers. But as I have to expire
the cache at the end of the month I was thinking on the lines of doing
it in a rake task.
I had tried this but it showed me an error while running the task

You could look into Rails.cache.delete(path_and_fragment_name)