Skip to content

Instantly share code, notes, and snippets.

@Samda
Created December 25, 2020 10:26
Show Gist options
  • Save Samda/ebd19aeede1883ac7494b5b551a51a3c to your computer and use it in GitHub Desktop.
Save Samda/ebd19aeede1883ac7494b5b551a51a3c to your computer and use it in GitHub Desktop.
Rails 6 and whenever with rbenv
set :output, "#{path}/log/cron.log"
set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"'
job_type :rails, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec rails :task --silent :output }
job_type :runner, %q{ cd :path && PATH=:env_path:"$PATH" bin/rails runner -e :environment ':task' :output }
job_type :script, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec bin/:task :output }
every 1.minute do
rails 'message:send_to_clients'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment