Rake tasks scheduled in Heroku found online are in the "rake task-name
" format. Heroku passes in an :environment argument to the rake task, but there is no documentation about extra args being passed to a task listed in scheduler.rake
Asked
Active
Viewed 1,825 times
2 Answers
2
You may try this:
task :my_task, [:arg1, :arg2] => :environment do |t, args|
puts "Args were: #{args}"
end
and then run manually to see the output:
heroku run rake my_task
UPDATE:
this answer can be an old one already

CodeGroover
- 2,157
- 19
- 25
-
Possibly dumb question, but shouldn't that last line be `heroku run rake my_task arg1, arg2`? – jayp Feb 21 '18 at 21:39
2
Instead of rake task_name
input rake task_name[arg1, arg2]
to the string input accepted by the Task column in the Heroku Scheduler main screen.
As mentioned by CodeGroover, your rake task defined in lib/scheduler.rake
should define the parameters it is expecting.

cabe56
- 404
- 2
- 14