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 <internal:rubygems/core_ext/kernel_require.rb>: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
This commit is contained in:
Javi Martín
2024-09-13 15:30:07 +02:00
parent ddfe723e25
commit 3cdf7194a0

View File

@@ -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