ruby - whenever gem development environment rails not working -


i have rails application , want perform cron job(every 5 mins in development) via whenever gem...

i have rake task in: lib/tasks/appname.rake

code inside is:

namespace :appname   desc "importing data overnight"   task import_data_overnight: :environment     puts "importing..."     object.import_data   end end 

when in terminal run:

$bundle exec rake appname:import_data_overnight 

my development database gets updated perfectly.

adding in whenever gem put in:

gemfile: gem 'whenever', require: false

cd project

ran: $wheneverize .

inside config/schedule.rb:

set :environment, :development set :output, {:error => "log/cron.log", :standard => "log/cron.log"}  every 5.minutes   rake "appname:import_data_overnight" end 

save file, inside terminal ran:

$whenever --update-crontab --set environment=development 

this output in cron.log:

jun  4 13:05:00 jatins-macbook-pro.local /usr/sbin/cron[34183]: (jatin) cmd (/bin/bash -l -c 'cd /users/jatin/dev/apps/appname && rails_env=development bundle exec rake appname:import_data_overnight --silent >> log/cron_log.log 2>> log/cron_error_log.log') 

looks running, when check db there no sign of activity, no records touched.

any ideas?


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -