rails cron job
Rails job & whenever gem
https://guides.rubyonrails.org/active_job_basics.html
https://github.com/javan/whenever
https://guides.rubyonrails.org/active_job_basics.html
https://github.com/javan/whenever
rails generate job parse_schedule
how to run in development env
whenever --update-crontab --set environment=development crontab -l ```bash 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /Users/rhee/project/cms && bundle exec bin/rails runner -e development '\''ParseScheduleJob.perform_now'\'' >> ./log/cron_log.log 2>&1' ```
https://github.com/javan/whenever/issues/351
https://stackoverflow.com/questions/11514968/rails-using-whenever-gem-in-development
Troubleshooting
https://stackoverflow.com/questions/11514968/rails-using-whenever-gem-in-development
Troubleshooting
if have error $ cat ./log/cron_log.log objc[61258]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. objc[61258]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. ```bash export DISABLE_SPRING=true ```