When i deploy to pre
server everything's woking fine. But if i try to deploy to staging
server i get this error:bundler: command not found: bin/delayed_job
file - config/deploy/staging.rb
set :rails_env, 'staging'
set :eager_load, :true
set :unicorn_rack_env, 'staging'
role :app, %w{[email protected]}
role :web, %w{[email protected]}
role :db, %w{[email protected]}
set :rvm_type, :auto # Defaults to: :auto
set :rvm_ruby_version, '2.1.2'
set :rails_env, 'staging'
set :eager_load, :true
role :app, %w{[email protected].}
role :web, %w{[email protected].}
role :db, %w{[email protected].}
set :rvm_type, :auto # Defaults to: :auto
set :rvm_ruby_version, '2.1.2'
set :deploy_to, '/var/www/app'
server 'x.x.x', user: 'deploy', roles: %w{web app} , port: 222
set :unicorn_pid, ->{ "#{deploy_to}/shared/tmp/pids/unicorn.pid" }
set :scm, :git
set :ssh_options, { user: 'superman' }
set :keep_releases, 5
restart of delayed jobs -
namespace :delayed_job do
def args
fetch(:delayed_job_args, "")
end
def delayed_job_roles
fetch(:delayed_job_server_role, :app)
end
desc 'Stop the delayed_job process'
task :stop do
on roles(delayed_job_roles) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, :exec, :'bin/delayed_job', :stop
end
end
end
end
desc 'Start the delayed_job process'
task :start do
on roles(delayed_job_roles) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, :exec, :'bin/delayed_job', args, :start
end
end
end
end
desc 'Restart the delayed_job process'
task :restart do
on roles(delayed_job_roles) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :bundle, :exec, :'bin/delayed_job', args, :restart
end
end
end
end
end
Could you please give me a hand in this issue ? Thanks in advance!
UPDATE 1
More info on this error :lib/capistrano/tasks/delayed_job.rake:33
which is execute :bundle, :exec, :'bin/delayed_job', args, :restart
You should run once on destination server:
bundle exec rails generate delayed_job
This will generate delayed_job executable script in shared/bin
Check if you can see delayed_job on your staging server in #{deploy_to}/shared/bin/
If it's not there, copy it there from your project's bin
folder.
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