running file ruby on whenever/crontjob ruby

285 views Asked by At

how to running file ruby in whenever, in this case i'm not using rails. If in example rails code, i'm only must running this code and it's work :

example in rails :

every 3.hours do
  runner "MyModel.some_process"
end

but if i want to running file with extenstion .rb without rails, how do that :

example similiar code like this :

 every 3.hours do
   runner "ruby test.rb"
 end

thanks before

1

There are 1 answers

0
ptierno On BEST ANSWER

Use command instead of runner:

every 3.hours do
  command "ruby test.rb"
end

Hope this helps.