capistrano-sidekiq
capistrano-sidekiq copied to clipboard
Why not use `bundle exec sidekiq` ?
In my environment, cap production sidekiq:start
dies immediately.
The capistrano's boot up sidekiq via below command.
$ sidekiq --index 0 --pidfile /opt/my_application/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /opt/my_application/shared/log/sidekiq.log --config /opt/my_application/current/config/sidekiq.yml -r /opt/my_application/current --daemon
It uses system installed sidekiq
.
And it bytes me environment related bug.
How about boot up sidekiq via
/opt/my_application/current/bin/bundle exec sidekiq
command? It worked me in CLI test.
You either not using capistano-bundler or overriding a default option. show me your deploy.rb
https://gist.github.com/kumagi/99b20d12cf1d5c5b27a7b5793fb51798 I could not find the corresponding option to use bundler. Please let me teach.
From Gemfile.lock
I found capistrano-bundler
capistrano (3.8.2)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (1.2.0)
capistrano (~> 3.1)
sshkit (~> 1.2)
I finally resolved. Adding below configuration in my deploy/production.rb
set :bundle_bins, %w{gem rake rails sidekiq}
It works well for me. How about writing it in README.md?
Same problem here.
Definition of bundle_bins
does not seem to be the solution, since capistrano-sidekiq itself currently does it.
When I force gem code to run without --daemon
option, local execution is stuck (as expected) and remotely the sidekiq process is running as well.
The problem seems to be in the daemonization.
If I run directly in the server the same command capistrano-sidekiq runs, everything works fine.
@kumagi, @rodrigomanhaes,
I had the same issue, and to fix it - I simply moved require 'capistrano/sidekiq'
line in Capfile lower, I guess it should go lower than require 'capistrano/bundler'
line.