FAQ Database Discussion Community


Rails: Model method doesn't execute as a cron task in development

ruby-on-rails,ruby,cron,youtube-api,whenever
I am currently writing an application in Ruby on Rails that fetches data (videoId as a string, title as a string, thumbnail url as a string, and date of when video was created as a datetime type) from YouTube and saves it to the database. I have tested YouTube API...

How to check if whenever gem is working?

ruby-on-rails,ruby,cron,whenever
I've got the following configuration. I've installed whenever gem, created shedule.rb: # Learn more: http://github.com/javan/whenever every 6.hours do runner "Part.check_status_update" end In part.rb model I have corresponding method. A. How can I check if whenever runs? As I understand it should only modify the crontab after whenever command in the...

Rails + Whenever: run tasks with same schedule in different days

ruby-on-rails,whenever
I'm using whenever gem to run schedule jobs. My schedule.rb has something like this: every 3.days, :at => '2:10 pm' do runner "Something.task()" end every 3.days, :at => '1:10 pm' do runner "Something.othertask()" end The thing is, is it possible to define that the first job starts to run today...

In Whenever gem, if we use every :month, does it mean the end of month or beginning?

ruby-on-rails,whenever
When using the whenever gem we can set a monthly job like this : every :month do ... end Will this run the job at the end of the month or at the start of the month? I want to run it at the end....

Rails scheduled task behind a load balancer

ruby-on-rails,amazon-ec2,cron,whenever,whenever-capistrano
I was wondering how to properly schedule a task for a rails application that sits behind an elastic load balancer. This task is an automated weekly email that is to be sent out every Monday from the application. We currently have multiple EC2 instances that sit behind a LB. I...

rails 4.2.0 with whenever gem in development env, not working

ruby-on-rails,development-environment,whenever
Hi everyone I have such problem: I'm using rails 4.2.0 with rvm gemsets (using right ruby version and correct gemset with installed gems). I'm trying to make some cron task using whenever gem, but I can't make it work. This is what I have: Gemfile gem 'whenever', :require => false...

AWS Elastic Beanstalk and Whenever Gem

ruby-on-rails,ruby-on-rails-4,amazon-web-services,elastic-beanstalk,whenever
I have a Rails 4.2.1 app, using Ruby 2.2. I'm trying to use the Whenever Gem to update cron tasks on my Elastic Beanstalk from my code base. I've followed a few resources from AWS where you can add files to the .ebextensions folder and use EB's post deployment hook...

whenever gem not working, Rails 4

ruby-on-rails,ruby,ruby-on-rails-3,cron,whenever
I am using Whenever gem to schedule some work on my site. Currently I am working on development environment. I have instaled gem as guide suggests. In schedule.rb every 2.minutes do rake "vip_recomend:give" end In lib/tasks/vip_recomend.rake namespace :vip_recomend do desc "Give vip recomend to ads that are in waiting list"...

Gemfile not found when running Cron job with Capistrano 3 and whenever gem

ruby-on-rails,capistrano,bundler,whenever
My cron job works fine on my local machine after running whenever -w, after deploy to my VPS, I get this error, release 20150415044915 doesn't exist. any idea? I looked at my crontab -e, the path also looks fine where 20150502114703 is the correct release: 0 1 * * 1...

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

ruby-on-rails,whenever
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?...

Where do I put model so that whenever could access them?

ruby-on-rails,model,whenever
Simple and maybe stupid question. Just where? Simple generated model in /models doesn't work, and new class in /lib doesn't also... Just errors about undefined methods etc. schedule.rb every '* * * * *' do runner 'UpdateDaysAgo.test' end model class UpdateDaysAgo < ActiveRecord::Base def test UpdateDaysAgo.create(channel: "nil", title: "nil", game:...

undefined method `company_name' for nil:NilClass Rails mailer views not rendering variables from controller

ruby-on-rails,ruby-on-rails-3,actionmailer,whenever
I have setup a Task that check for all the followups that are outstanding by a date. I have now send up a task that will run and check for outstanding follow ups for the day and send out an email reminder. All working i think but i can't get...

Gemfile not found using Cron job with Capistrano 3 and whenever gem

ruby-on-rails,cron,capistrano3,whenever
Cron Job Working Fine on my pc. But when i deploy it to the server using capistrano. The cron.log file show that it is looking for that release which is not present on server how can i resolve this problem. any idea...? /home/deployer/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.7.2/lib/bundler/definition.rb:22:in `build': /home/deployer/apps/production_app/releases/20140906112257/Gemfile not found (Bundler::GemfileNotFound) from When...

Sidekiq Rails 4.2 Use Active Job or Worker? What's the difference

ruby-on-rails,asynchronous,sidekiq,whenever,rails-activejob
This is my first processing jobs asynchronously I am implementing Sidekiq for background processing in my app. I will use it for reminder emails and in-app notifications. I am confused as to whether I should use Active Job to create a job that sends an email or a Sidekiq Worker...