Questions tagged [whenever]

a Ruby gem that makes it possible to define cron tasks in Ruby

whenever is a Ruby gem that makes it possible to write and maintain cron tasks in Ruby, using a simplified and expressive syntax.

Resources

Related Tags

500 questions
3
votes
2 answers

Delayed Job vs. Cron in Rails

My application (in Rails) should provide two main tasks: create activity (for example post to Twitter) in given time in the future periodically crawler some site or download Tweets I'm thinking about using DelayedJob gem or Whenever gem for cron…
kmaci
  • 3,094
  • 2
  • 18
  • 28
3
votes
2 answers

My Ruby script (automated using Whenever gem) isn't running..what am I doing wrong?

The script is in the file fxrates_scraper.rb, code below. The scheduler i'm using is in the schedule.rb file, code below. I'm using the whenever gem, and when i type in 'bundle exec whenever' i see the task as scheduled, it seems fine. but it…
hikmatyar
  • 265
  • 3
  • 14
3
votes
2 answers

Error running cron job `require': cannot load such file -- bundler/setup (LoadError)

I have deployed application using Capistrano 3. I keep on getting following error. `require': cannot load such file -- bundler/setup (LoadError) Here is the cron tab…
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
3
votes
3 answers

rake aborted! ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: Trouble Getting Rake Automation to Work

I'm working on making a to-do list application and I'm trying to implement a feature where a to-do list item will automatically be deleted after 7 days if it never was completed within that time period. I'm trying to use rake automation with the…
jlquaccia
  • 165
  • 3
  • 13
3
votes
2 answers

Rails whenever gem: schedule task between two times?

Suppose I wanted to run a rake every x minutes between two times every day? How might I do that? Would between work? Or until? Or must I use cron syntax? # Refresh daily scores every 5.minutes, # :between '3pm' :and '1am' do ? rake…
iamse7en
  • 609
  • 8
  • 21
3
votes
0 answers

Rails Whenever set environment

I'm using whenever to generate the cronjobs for my Rails application. Rails 4.2.1 In the schedule.rb I have something like that: every 13.minutes do rake "crons:dosomething" end This generates a cronjoblike this: RAILS_ENV=production bundle…
Felix
  • 5,452
  • 12
  • 68
  • 163
3
votes
2 answers

'NoMethodError: undefined method' in Ruby on Rails Model

I am creating a system that recurring payments each month so I am creating a new payment requirement using the whenever gem The problem seems to be in my Payment model method, which is here. class Payment < ActiveRecord::Base belongs_to :client …
LuigiAlver
  • 191
  • 1
  • 2
  • 13
3
votes
1 answer

How can I run controller action with whenever gem in Rails?

for example I have a controller "Posts" and action "create". Can I run it from terminal? I want to use whenever gem: every 2.hours do # I want to run posts#index end How can I do it?
user2366061
3
votes
2 answers

How to schedule whenever task based on a table column?

I am using whenever gem to run rake tasks. My code in schedule.rb is as follow. every 1.day, :at => '11:00 am' do rake "notifications:run_mailer" end Above code is executing the rake task on 11am of every day. Now i want to change this. I want…
Can Can
  • 3,644
  • 5
  • 32
  • 56
3
votes
1 answer

Cron job every day from 8AM to 8PM at 20 minutes interval

How to run cron job every day from 8:00 AM to 8:00 PM at 20 minutes interval eg cron job should start at 8:00 AM every day, then run at 8:20 AM then 8:40 AM then 9:00 AM up to 8:00 PM. Thanks. EDIT: How to Implement it with ruby whenever gem.
Braham Shakti
  • 1,408
  • 4
  • 22
  • 39
3
votes
1 answer

Whenever gem on aws opsworks

Does anyone have experience/success using the whenever gem on aws opsworks? Is there a good recipe? Can I put that recipe on a separate layer and associate one instance with that additional layer? Or is there a better way to do it? …
nroose
  • 1,689
  • 2
  • 21
  • 28
3
votes
1 answer

Ruby on Rails whenever + capistrano v3 integration

In my project im using whenever + capistrano, so here is my Capfile: require 'capistrano/setup' require 'capistrano/deploy' require 'capistrano/rvm' require 'capistrano/bundler' require 'capistrano/rails/assets' require…
xamenrax
  • 1,724
  • 3
  • 27
  • 47
3
votes
2 answers

How to get the cron working when using Javan-whenever in Rails

I have setup my schedule.rb file as follows. set :cron_log, "/log/cron_log.log" if Rails.env.development? every 1.minute do runner "SomeModel.move_values" runner "SomeOtherModel.dispense" end end I also make it work in development mode…
Sid
  • 6,134
  • 9
  • 34
  • 57
3
votes
1 answer

Use whenever with sinatra

I'm trying to get whenever to work with sinatra. When I run the whenever command, I get the generated cron tab. But the problem is, that in my sinatra app, I don't have a script/runner file, which is present in Rails. How do I get this runner, or is…
23tux
  • 14,104
  • 15
  • 88
  • 187
3
votes
1 answer

Is there any possibility to run a cron job with dynamic time interval ? Please suggest

Is there any possibility to run a cron job with dynamic time interval? Please suggest. I have used Ruby on rails, whenever .
user2049514