ruby on rails - How to test rake tasks with Whenever Gem? -


i'm trying execute simple rake task using whenever gem code isn't being executed.

i set environment development, updated cron using whenever --update-crontab command , rake task works if run command on console. but, when run server log file not being generated.

i saw question here same problem solved setting environment development, didn't work out me.

my rake task:

namespace :testando   task :consulta => :environment     produto = produto.first     puts produto.nm_produto   end   end 

my schedule.rb:

set :output, "#{path}/log/cron_log.log" set :environment, 'development'  every 1.minute   rake "testando:consulta" end 

i'm using rails 5.0.0.1 , i'm programing in cloud9, think os ubuntu.

what's missing ?

update:

i followed instructions of main answer in topic cron job not working in whenever gem

and worked! task running server not being started (with "rails s" command).

please run crontab -l see if have updated crontab successfully


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -