2

Rails 3.1 + Whenever gem. I've got 2 jobs scheduled in Whenever. However, apparently nothing happens. I have tried these methods through Heroku console, and they work. So I reckon that they do not get fired at any point. Am I missing something?

config/schulde.rb

every 1.day, :at => '03:30' do
 runner "Alarm.proba"
end

every 1.day, :at=> '3:32 am' do
 runner "Alarm.proba2"
end

Alarm model

def self.proba
 @event = Event.find(10)
 @user =User.find(12)
 EventNotifier.alarm(@event, @user).deliver
end

def self.proba2
 @event = Event.find(10)
 @user =User.find(13)
 EventNotifier.alarm(@event, @user).deliver
end

$ crontab -l

# Begin Whenever generated tasks for: quasi
5 4 * * * /bin/bash -l -c 'cd /Users/sergioabendivar/railsProjects/Tutos/quasi && script/rails runner -e production '\''Alarm.proba'\'''

5 4 * * * /bin/bash -l -c 'cd /Users/sergioabendivar/railsProjects/Tutos/quasi && script/rails runner -e production '\''Alarm.proba2'\'''

I assume that it woks in development because my console now says "You have an email". Actually if I check the email I got quite a lot.

vinknee
  • 147
  • 1
  • 7
Sergio Nekora
  • 319
  • 1
  • 5
  • 19
  • if running local you can enter enable sendmail in console wich handles the delivery. also make sure your smtp properties are set correctly. – dennis Apr 12 '12 at 11:15
  • It is in heroku. If a run Alarm.proba from heroku console I receive the email. It works fine. – Sergio Nekora Apr 12 '12 at 11:30
  • Solution! Whenever gem deleted and Heroku Scheduler added. http://blog.heroku.com/archives/2011/11/12/heroku_scheduler_add_on_now_available – Sergio Nekora Apr 21 '12 at 13:46

1 Answers1

2

Use Heroku Scheduler instead: https://devcenter.heroku.com/articles/scheduler

Neal
  • 4,468
  • 36
  • 33