Täglich Shaarli

Alle Links eines Tag auf einer Seite.

January 17, 2022

How to run rake tasks from console?
thumbnail

Running your Rake tasks requires two steps:

Loading Rake
Loading your Rake tasks
You are missing the second step.

Normally this is done in the Rakefile, but you have to do it manually here:

require 'rake'
Rails.application.load_tasks
Rake::Task['my_task'].invoke