In my Rails 4.2 app, I'm using sitemap_generator gem to generate sitemaps. And use Heroku scheduler to execute the rake task. I think it'd be better if the sitemap is generated when there is new content or execute a manual action from admin panel by clicking a button to generate sitemap and ping search engines.
So, in my ActiveJob, I'm executing following in background Job
Rake::Task['sitemap:refresh'].invoke
But it gives me the error that it doesn't know, how to build this task.
RuntimeError: Don't know how to build task 'sitemap:refresh' (see --tasks)
Thanks,