I'm trying to run the following command on my remote server (either via capistrano or ssh):
bundle exec RAILS_ENV=production script/delayed_job start
But I'm getting this error message: bundler: not executable: script/delayed_job
Never saw this before, and google had nothing for me. Any idea what might be the problem?
Maybe it does not have permissions to run? Try running this command
chmod +x script/delayed_job
and then executing the file again.
I am not sure if if it is a fundamental misunderstanding of the capistrano rbenv gem or some issue with the gem itself, but I had similar issue with delayed_job, where the bin/delayed_job file just would not get the executable permission when copied to the server by capistrano. So I wrote a task which I had run before invoking the delayed_job:restart task.
Note - Adding this answer because earlier one is from 2014, and also I wanted to show how to add the task, so the permission change can happen during deployment itself.
Created a task in lib/capistrano/tasks folder (in namespace delayed_job):
namespace :delayed_job do
desc 'Ensure that bin/delayed_job has the permission to be executable. Ideally, this should not have been needed.'
task :ensure_delayed_job_executable do
on roles(delayed_job_roles) do
within release_path do
execute :chmod, :'u+x', :'bin/delayed_job'
end
end
end
end
after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
task :restart do
invoke 'delayed_job:ensure_delayed_job_executable'
invoke 'delayed_job:restart'
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With