我使用的是每當gem創建rake任務時,我期待得到一個線輸出「在任務的教學Thabo如何安排任務」每2分鐘,我是新來的Rails,這裏是我有一個名爲request_invoice.rakeRuby on Rails crontab任務已安排但未運行
namespace :request_invoice do
desc "Teaching Thabo how to schedule tasks"
task test_tasking: :environment do
puts "Learning the tasking in rails..."
end
end
爲我耙任務文件中的代碼和寶石時在我的項目的配置創建一個schedule.rb文件,我有以下代碼
every 2.minutes do
rake 'request_invoice:test_tasking'
end
我已經在終端上運行的命令時,它提供了以下:
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,5 2,54,56,58 /bin/bash -l -c 'cd /home/sable/GMS/grading- management-solution && RAILS_ENV=production bundle exec rake request_invoice:test_tasking --silent'
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
是的,我確實運行了--update-crontab它給了回來這個:[write] crontab文件更新 – Teebo