Take the 2-minute tour ×

Currently I have this in my schedule.rb:

every 1.minutes do
    runner "Cronjob.cronjob"
set :output, File.join(path, 'log', 'cron.log')

and in my Cronjob model:

class Cronjob
  def self.cronjob
    events=Event.find :all

I don't want a table to accompany this model so hence the lack of < ActiveRecord::Base

However I'm being told that:

Could not find table 'events' (ActiveRecord::StatementInvalid)

Is this as a result of the missing < ActiveRecord::Base or is it because this is a cron job or is it something else,like something to do with class and instance methods?

share|improve this question
Do you have an events table? –  InternetSeriousBusiness Aug 24 '12 at 9:21
@InternetSeriousBusiness yes I do thats the thing. could it be that cron jobs are external as such. Note this is run on localhost –  Niall Aug 24 '12 at 9:35
Are you running that code in another environment, where the table doesn't exists (fe. development instead of production or viceversa)? –  InternetSeriousBusiness Aug 24 '12 at 10:00
@InternetSeriousBusiness that could be it indeed give me a minute to check –  Niall Aug 24 '12 at 10:09
@InternetSeriousBusiness it isn't that –  Niall Aug 24 '12 at 10:44

Your Answer



Browse other questions tagged or ask your own question.