Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capistrano-sidekiq is broken with capistrano-rbenv #147

Closed
Kukunin opened this issue Mar 10, 2016 · 9 comments
Closed

capistrano-sidekiq is broken with capistrano-rbenv #147

Kukunin opened this issue Mar 10, 2016 · 9 comments

Comments

@Kukunin
Copy link

Kukunin commented Mar 10, 2016

I've figured out, that this commit breaks sidekiq capistrano task: 8a49d76.

I get this command running:

DEBUG [c94fd95b] Finished in 0.397 seconds with exit status 0 (successful).
INFO [eb270192] Running bundle exec sidekiqctl stop /var/www/matic-home/shared/tmp/pids/sidekiq.pid 10 as deploy@m-staging-01.matichome.com
DEBUG [eb270192] Command: cd /var/www/matic-home/current && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.1.5" ; bundle exec sidekiqctl stop /var/www/matic-home/shared/tmp/pids/sidekiq.pid 10 )

Instead, I expect this command to run

INFO [69501030] Running RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.1.5 $HOME/.rbenv/bin/rbenv exec bundle exec sidekiq --index 0 --pidfile /var/www/matic-home/shared/tmp/pids/sidekiq.pid --environment production --logfile /var/www/matic-home/shared/log/sidekiq.log -q default -q mailers -q sync -c 3 --daemon as deploy@m-staging-01.matichome.com
DEBUG [69501030] Command: cd /var/www/matic-home/current && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.1.5" ; RBENV_ROOT=$HOME/.rbenv RBENV_VERSION=2.1.5 $HOME/.rbenv/bin/rbenv exec bundle exec sidekiq --index 0 --pidfile /var/www/matic-home/shared/tmp/pids/sidekiq.pid --environment production --logfile /var/www/matic-home/shared/log/sidekiq.log -q default -q mailers -q sync -c 3 --daemon )
INFO [69501030] Finished in 1.199 seconds with exit status 0 (successful).
@seuros
Copy link
Owner

seuros commented Mar 10, 2016

You are using bundler, you should add capistrano-bundler to your gem files.

@Kukunin
Copy link
Author

Kukunin commented Mar 10, 2016

I use it already. I have

gem 'capistrano-rails', '~> 1.1', require: false

in my Gemfile, which has

capistrano-rails (1.1.6)
  capistrano (~> 3.1)
  capistrano-bundler (~> 1.1)

in Gemfile.lock.

The problem is that I have ruby installed via rbenv on the server, with no global ruby. It worked perfectly until v0.5.4 release. I've figured out, that reason is that commit from first message.

@stefanosc
Copy link

same issue here, reverting to 0.5.3 prevents it.

@stefanosc
Copy link

@Kukunin did you find a way to get the latest release to work?

@stefanosc
Copy link

@Kukunin @seuros could you share anything?
Thank you!

@guillehorno
Copy link

Hi,
I faced the same issue and diggind around the capistrano-sidekiq code found this setting that made the bundle exec work correctly (with the env variables of rbenv). You just need to add this into the deploy.rb file

set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w(sidekiq sidekiqctl))

Hope it helps.

@Paprikas
Copy link
Contributor

I have just added to default rbenv_map_bins
set :rbenv_map_bins, %w(rake gem bundle ruby rails sidekiq sidekiqctl)

@lbraun
Copy link

lbraun commented Jan 9, 2017

We are using rvm so I had to add:

set :rvm_map_bins, %w(rake gem bundle ruby rails sidekiq sidekiqctl)

Using concatenation did not work. Can anyone explain why this is necessary? Does capistrano-sidekiq delete the default rvm_map_bins somehow?

@jkarnesPerfectCube
Copy link

It does not delete them, but it does set them based on what currently exists: set :rvm_map_bins, fetch(:rvm_map_bins).to_a.concat(%w(sidekiq sidekiqctl))

@seuros seuros closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants