2

I am using whenever gem my schedule.rb content is

every 2.minutes do runner "Refinery::Page.update_publishing_date_to_list_in_menu" end

I get this by crontab -l

# Begin Whenever generated tasks for: /home/harssh/Documents/Aptana Studio 3 Workspacwinbox/wineboxnew/config/schedule.rb

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58
* * * * /bin/bash -l -c 'cd /home/harssh/Documents/Aptana\ Studio\ 3\ Workspacwinbox/wineboxnew && RAILS_ENV=production bundle exec rake page:publish --silent'

# End Whenever generated tasks for: /home/harssh/Documents/Aptana Studio 3 Workspacwinbox/wineboxnew/config/schedule.rb

This runs well on my ubuntu 10.10

But I get (CRON) error (grandchild #26321 failed with exit status 127) on my debian server where I am using apache and passenger with rvm using Ruby 1.9.3

If I use script in terminal in debian it also runs properly but automated cron task gives error

Grey
  • 676
  • 8
  • 23

1 Answers1

1

I am also faced same problem, Finally I resolved this issue.

Problem 1: Ruby path in script/runner file

ruby path in script/runner file:

#!/usr/local/bin/ruby

You can replace (/usr/local/bin/ruby) with your machine ruby path. You can check ruby path with the following command in your machine:

which ruby

Problem 2: I think your runner don't have execution permission.

You can set execution permission to runner file the following way:

Ruby project path/script> chmod +x ruuner

SIVA
  • 32
  • 5