Ruby on Rails 4 Whenever cron job not working

cron, ruby-on-rails, whenever

Solution

You will have to execute

whenever -i

to add the jobs to crontab

Problem

I would like to use Whenever gem to run scheduled jobs in my RoR application. I run the bundle install and this is my schedule.rb: ``` every 1.minute do runner "Event.executeEvents" end ``` My Event.executeEvents method is a simple log entry: ``` class Event < ActiveRecord::Base def executeEvents puts "executeEvents at [" + Time.now.inspect + "]" end end ``` If I execute `whenever` in command line, I got this: ``` $ whenever * * * * * /bin/bash -l -c 'cd C:/dev/yanpyapi && bin/rails runner -e production '\''Event.executeEvents'\''' ## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated. ## [message] Run `whenever --help' for more options. ``` Nothing is executed. What I´m missing? Do I need to initilize it somehow? I have read some doc about capistrano and RVM, but I don´t know what is this for...

Original source

Related problems