top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Testing of cron job using Whenever gem in rails-3

0 votes
444 views

I did the following to implement cron jobs in rails 3 using a "runner" instead of a rake task.

STEP 1: I have whenever gem installed and scheduler.rb has following:
set :environment, development set :output, { :error => "/log/error.log", :standard => "/log/cron.log" } every 1.minute do runner "Cron.sendAutomaticsSMS()" end

STEP 2:
Cron file: lib/cron.rb
class Cron $ # End Whenever generated tasks for: /code/rails_projects/new/bhk/bigbhk-dev/

STEP 3:
Running cron job:
$sudo service cron restart cron stop/waiting cron start/running, process 4027

This does not do anything. I wait for operation as defined in sendAutomaticsSMS() method to execute but the cron doesnt even enter this method.

I dont see any error in log/development.log and there is no log/cron.log in my rails app.

posted May 28, 2014 by Jagan Mishra

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
What is the contents of your crontab? Use crontab -l to list...

Similar Questions
+1 vote

I have to build some report screeen for my project I want to use highcharts-rails gem to build this screen
I research some document about it but I want someone have ever done with highcharts-rails gem can give me some advice if I use highchart in Rails

+1 vote

I have tried to post others wall (means not in my friends list). Am getting the below error

Unsupported Get request.

Any suggestion.

+1 vote

Anyone can help me figure out why the blogit gem dates posts a month ahead of today?

+1 vote

Rails seems to have a whole whack of them and I'm not sure which ones match my requirements. The library must:

  • be fully themeable; the overall layout is going to be made from scratch
  • allow custom content for pages (i.e. a developer-made page)
  • allow defining of different types of posts with different fields/data
  • support image upload for at least pages and preferably posts as well
  • be relatively easy to extract post content outside the CMS (e.g. for use in sending an e-mail digest)

Preferably it should:
- Be compatible with Rails 4
- allow individual pages to be user-edited with HTML/CSS after they've been created

Can anyone recommend one for me?

...