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
0 answers

Rubber Gem + Whenever Gem = error cannot load such file -- bundler/setup

I am hoping you have suggestions on how I can have rubber cron and whenever cron live together? As you can see in the crontab -l output below, the rubber cron jobs wants to set the PATH variable. Which causes the cron job created by Whenever gem to…
George
  • 658
  • 5
  • 12
2
votes
3 answers

whenever => cron job not accessing my model/database

I am using whenever gem to create a cron job. This cron job needs to run a helper method on my rails app at a regular interval. This helper method checks every instance of my model and decides to update it or…
tir38
  • 9,810
  • 10
  • 64
  • 107
2
votes
2 answers

Scheduling recurring task in ruby on rails 3.2

I have ruby on rails website,in which I want to perform some task at fixed interval such as 'sending report by email every sunday',for example. I have examined using whenever gem but since it is wrapper for the *nix utility cron,it may not work on…
Chirag Rupani
  • 1,675
  • 1
  • 17
  • 37
2
votes
3 answers

Missing required gems when execute cron created by whenever gem in production environment

I've ruby on rails application running in production, this apps have STOCK model and it should be updated every 1 minute. For updating this model i create simple rake task db:populate:stocks, when it contain only two operation : truncate the…
Agung Prasetyo
  • 4,353
  • 5
  • 29
  • 37
2
votes
1 answer

Cannot run Whenever task with sudo

I want to execute a task with whenever rails gem at every reboot like this every :reboot do script "cd :path && RAILS_ENV=:environment && rvmsudo ruby script/delayed_job start :environment" end however rvmsudo will prompt for the password what…
mottalrd
  • 4,390
  • 5
  • 25
  • 31
2
votes
2 answers

cron jobs set with whenever and accessing environment variables

I have a cronjob that calls a rails task that needs access to environment variables (S3 credentials). I have the environment variables set in my .bashrc and I can run the task from the command line, the cronjob though fails due to missing…
shane
  • 89
  • 2
  • 11
2
votes
1 answer

rails 3.1 Whenever gem works in development but not in production. Why?

Rails 3.1 + Whenever gem. I've got 2 jobs scheduled in Whenever. However, apparently nothing happens. I have tried these methods through Heroku console, and they work. So I reckon that they do not get fired at any point. Am I missing…
Sergio Nekora
  • 319
  • 1
  • 5
  • 19
1
vote
1 answer

How to setup Whenever gem in production (RVM)

I've one rake task which i want to execute once every day: in production installed rvm in schedule.rb i have set :output, "/home/username/data/public_html/log/cron_log.log" every 24.hours do rake "fetch:smth" end crontab -l shows…
Said Kaldybaev
  • 9,380
  • 8
  • 36
  • 53
1
vote
2 answers

Rails 3 / whenever cron not firing

I am using whenever to fire a rake task every 5 minutes for my app. schedule.rb: every 5.minutes do rake "audit", :environment => 'development' end "whenever" in console: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd…
John R
  • 301
  • 3
  • 14
1
vote
2 answers

Sending mails automatically through action mailer Rails 3.1

I have to send weekly emails to all the user about the latest things happening. I am using ActionMailer to accomplish other mailing task however I have no clue how to automate the weekly emails. Update I found whenever gem which could be used to…
Dev R
  • 1,892
  • 1
  • 25
  • 38
1
vote
1 answer

How do i access constant defined in Rails 3 application in "whenever" gem of schedule.rb file

i have few constants declared in application_controller.rb file. Is there any way to access them in schedule.rb file of whenever gem? Regards, Sudhir C.N.
sudhir
  • 320
  • 1
  • 5
  • 13
1
vote
2 answers

How can I create identical cron jobs for staging and production with the whenever gem?

I have one job in schedule.rb: set :output, File.expand_path('../log/whenever.log', __FILE__) set :job_template, "bash -l -c 'source ~/.bashrc ; :job'" every 1.day, :at => '12:01 am' do runner "MyModel.do_something" end In my staging deployment…
Simon
  • 1,716
  • 1
  • 21
  • 37
1
vote
1 answer

Whenever ruby scheduler doesn't work, what am I missing?

Cannot make it works ... In my config/schedule.rb I have : set :output, '../log/development.log' every 5.minutes do runner "UserWatchedRepo.update" end Note the log setted, but nothing happen. In my Rails 3.0.10 model file…
Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109
1
vote
1 answer

Rails Cron Job Not running for configured global ruby version MacOS

I am using rbenv to manage multiple ruby versions. I have the global and shell ruby version set as 2.7.6. I am using rails 7.0.4. My macos version is Monterey 12.5.1. rbenv global also outputs 2.7.6. I am using the whenever gem to create a simple…
Risalat Zaman
  • 1,189
  • 1
  • 9
  • 19
1
vote
1 answer

How do I run a Cron job which updates a particular column value once per day in ruby on rails?

Database - Postgres So I am very new to Ruby on rails and a Jr. developer so not very much aware of this task. I have a PLSQL query which checks if there is a child whose age is more than 5 from the current date. so this is connected to. another…
Akash
  • 83
  • 1
  • 6