Rails how to run rake task Rails how to run rake task ruby ruby

Rails how to run rake task


You can run Rake tasks from your shell by running:

rake task_name

To run from from Ruby (e.g., in the Rails console or another Rake task):

Rake::Task['task_name'].invoke

To run multiple tasks in the same namespace with a single task, create the following new task in your namespace:

task :runall => [:iqmedier, :euroads, :mikkelsen, :orville] do  # This will run after all those tasks have runend


Rake::Task['reklamer:orville'].invoke

or

Rake::Task['reklamer:orville'].invoke(args)


Have you tried rake reklamer:iqmedier ?

My custom rake tasks are in the lib directory, not in lib/tasks. Not sure if that matters.