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
2
votes
1 answer

Cron tabs cannot find proper Ruby version via Whenever gem

I wanted to set a cron tab which would execute a task located in my Rails app. In my config/schedule.rb: every 2.minutes do #do something end Despite putting this task successfully into my cron jobs list it never gets executed. When I try to…
andrzej541
  • 919
  • 1
  • 9
  • 21
2
votes
1 answer

Whenever gem for cron in Rails can not be running in Mac and can't found the log

in my config/schedule.rb: set :environment, "development" set :output, "log/cron.log" every 2.minutes do rake "reset_expired_pin:generate" end then i run whenever --update-crontab --set environment='development' then crontab -l i see the cron…
certual
  • 87
  • 9
2
votes
1 answer

Whenever gem to trigger Rails' ActiveJob vs rake task to run regularly scheduled task | Rails 5

I'm working on a Rails 5.2 project that requires a scheduled asynchronous task to run nightly. I've been looking at the differences between using the whenever gem to trigger an ActiveJob job, and using whenever to trigger an old-style rake task…
simonlehmann
  • 852
  • 1
  • 10
  • 27
2
votes
2 answers

Schedule a task to work on 15th and the last day of the month in ruby

I have defined a rake task to work on the 15th and last day of the month at 8 am in schedule.rb file. I just wanted to confirm if I have done it the right way. Please have a look and suggest it. run this task at 8am on 15th of every month every '0 8…
user12763413
  • 1,177
  • 3
  • 18
  • 53
2
votes
2 answers

bundler: not executable: bin/rails in rails production while using whenever gem

I'm using whenever gem for cronjobs in rails application - production. I'm getting an error bundler: not executable: bin/rails scheduler.rb every 15.minute do runner 'TestJob.perform_later()' end crontab 0,15,30,45 * * * * /bin/bash -l -c 'cd…
Abhishek Aravindan
  • 1,432
  • 6
  • 23
2
votes
1 answer

Update crontab (Whenever gem)

By executing the whenever --update-crontab command, the following error returns: /usr/lib/ruby/vendor_ruby/whenever/cron.rb:132:in `parse_as_string': Couldn't parse: 31557600 (ArgumentError) from /usr/lib/ruby/vendor_ruby/whenever/cron.rb:112:in…
2
votes
2 answers

Rails cron with whenever

I don't understand why "whenever" does not work Schedule.rb every 2.minutes do runner "Ping.check_pings" end Ping.rb class Ping < ActiveRecord::Base attr_accessible :LAN, :WAN, :info, :infastructure_id def self.check_pings …
Nostrodamus
  • 619
  • 1
  • 6
  • 8
2
votes
2 answers

Ruby curly bracket block syntax is not working while do...end works

I am using this gem. When I use the following syntax, it works fine: every :day do rake 'billing:daily' end However, when I use the following syntax, the gem is giving me syntax error: every :day { rake 'billing:daily'…
Utku
  • 2,025
  • 22
  • 42
2
votes
1 answer

Whenever Gem - Undefined method '(methodhere)' for User(call 'User.connection' to establish a connection):Class

I'm attempting to implement the Whenever gem into my RoR 5 application. Once a year I want it to run a method in my 'User' model, but for testing purposes I have made it once every minute, like so: Schedule.rb: set :output,…
Ant-IWH
  • 59
  • 7
2
votes
3 answers

Whenever Gem AWS elastic beanstalk

Apologies if this is a duplicate - there are a few results with similar questions but most of the answers are quite dated and I am having trouble getting it to work. I am using the whenever gem to run a single task every hour in my rails app but I…
timboon
  • 107
  • 1
  • 12
2
votes
1 answer

Whenever gem crontab being appended too instead of overwritten

It looks like my schedule.rb file contents are being appeneded to my crontab each time I deploy via capistrano. The only difference being the release directory I seem to have this in my crontab repeated for probably as many times as I have deployed…
Catfish
  • 18,876
  • 54
  • 209
  • 353
2
votes
0 answers

Rails Whenever gem and cron job not working on development environment

so this is like my first time doing a cron job, and also using a whenever gem. this is what's in my schedule.rb set :environment, :development every 1.minute do command "rails runner /home/ec2-user/projectA/scripts/download.rb" end It's…
Napmi
  • 521
  • 2
  • 13
  • 32
2
votes
1 answer

Whenever gem doesn't work on Ubuntu

I'm trying to make an automated backup system for my rails databases using the backup and whenever gem. I can successfully generate a config file for this and I can also run the backup (the backup gets stored on an Amazon server). For some reason…
royketelaar
  • 1,389
  • 2
  • 11
  • 21
2
votes
1 answer

NameError using whenever gem in Rails 5

I am using whenever and seed_dump gem. I am getting the following error while running whenever --update-crontab. config/schedule.rb:11:in `block in initialize': uninitialized constant Whenever::JobList::RAILS_ROOT (NameError) my schedule.rb…
poombavai
  • 111
  • 11
2
votes
1 answer

Where should I check after I set up environment variables for rails cron named “Whenever”?

CentOS 6.8 Ruby on Rails Cron: Whenever I set up environment variables for DB name, DB password and DB host. I am sure those variables show up with env command. But I cannot use them in rails codes or yaml files like <%= ENV["DB_NAME"] %>. They are…
Ken
  • 109
  • 9