From 3cdf7194a06a975accb196a489ed3d1d5600b272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 13 Sep 2024 15:30:07 +0200 Subject: [PATCH] Use bundle exec to run delayed jobs on reboot When running delayed_job on reboot using Consul Democracy 2.2.0, we were getting an error: ``` `require': cannot load such file -- sassc-embedded (LoadError) from :86:in `require' from config/application.rb:1:in ``` No idea why this gem isn't detected when running `bin/delayed_job`. When deploying with Capistrano, we use `bundle exec bin/delayed_job`, and that works fine, so we're using it here as well. We had already fixed this issue in the Cosul Democracy installer [1], but forgot to configure the Cron job to do the same. [1] https://github.com/consuldemocracy/installer/commit/3dc69eb6 --- config/schedule.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/schedule.rb b/config/schedule.rb index fcfd626e3..bf4a1b741 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -37,5 +37,5 @@ end every :reboot do # Number of workers must be kept in sync with capistrano's delayed_job_workers - command "cd #{@path} && RAILS_ENV=#{@environment} bin/delayed_job -m -n 2 restart" + command "cd #{@path} && RAILS_ENV=#{@environment} bundle exec bin/delayed_job -m -n 2 restart" end