Posts

Showing posts with the label gem

Setup a cron job or scheduler for your rails application using whenever gem.

cd path to your project. gem 'whenever', require: false   add it to your gemfile run bundle install bundle exec wheneverize .   //This will create an initial config/schedule.rb Now create your job call it  from config/schedule.rb whenever --update-crontab   //update crontab crontab -l   //list all cron job set :output, "log/cron.log"    //if you want to set log file for cron job then that this line at the top of config/schedule.rb         in production server:                   after deployment :  bundle exec whenever whenever --update-crontab crontab -l source: https://github.com/javan/whenever https://www.rubyguides.com/2019/04/ruby-whenever-gem/

An error occurred while installing nokogiri (1.8.4), and Bundler cannot continue.

An error occurred while installing nokogiri (1.8.4), and Bundler cannot continue. Try this first and then bundle install again   sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev