我需要每週發送一些電子郵件。 我安裝了郵件程序並做了幾次測試。工作正常。每當+梅勒不在一起工作
但我不能使用每當自動發送電子郵件。 已經在各種論壇中搜索,仍然無法修復。
型號/ HrCurriculumIntern
def self.send_reply_interns
@users = HrCurriculumIntern.where(:answer_sent => t('labels.n'))
InternMailer.send_reply_interns(@users).deliver
end
梅勒/ InternMailer
default :from => "[email protected]"
def send_reply_interns(users)
@users = users
mail(:to => "<[email protected]>", :subject => t('subjects.send_reply_interns'), :from => "[email protected]")
end
配置/ schedule.rb
set :environment, :development
every 2.minutes do
runner "HrCurriculumInterns.send_reply_interns"
end
我跟着這個步驟: 銪SEGUI埃斯蒂斯帕蘇斯:
發生故障。
每當
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,52,54,56,58 * * * * /bin/bash -l -c 'cd /var/www/form/3216/email/trunk && script/rails runner -e development '\''HrCurriculumInterns.send_reply_interns'\'''
## [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
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,52,54,56,58 * * * * /bin/bash -l -c 'cd /var/www/form/3216/email/trunk && script/rails runner -e development '\''HrCurriculumInterns.send_reply_interns'\'''
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
我看不到的問題,任何建議嗎?
在你的項目文件夾中,運行tail -f log/*。這將顯示所有包含cron的日誌。如果cron運行或不運行,請留意。保留一些記錄器來驗證。調試它。 – Bijendra