3

I'm trying to use a gem whenever on my rails application, it seems like its not working because I created a task in my model and defined a method that just prints out the time. whenever I try to run whenever -i it gives me the following error

 /usr/local/lib/ruby/gems/1.8/gems/whenever-0.6.2/lib/whenever/job_list.rb:21:in `initialize': undefined method `>' for :environment:Symbol (NoMethodError) 

I don't know if I might be doing something wrong when I setup the gem. I am testing it on development environment

My code is as follows

schedule.rb


  every 1.minutes do
    runner "Sale.unverified_notifications" , :environment > :development
  end

and my model is as follows

   def self.unverified_notifications
     logger.info Time.now.to_s
   end

Please I need to know if I may be doing something wrong.

Thank you in advance

Michael Eakins
  • 4,149
  • 3
  • 35
  • 54
Dee-M
  • 932
  • 5
  • 21
  • 36

1 Answers1

7
every 1.minutes do
    runner "Sale.unverified_notifications" , :environment => :development
  end

Seems better :)

shingara
  • 46,608
  • 11
  • 99
  • 105
  • Thanks Shingara, it was a typing error that i have noticed but forgot to update to the forum. it works very nice now. – Dee-M Nov 18 '10 at 13:23