Closed Altonymous closed 10 years ago
do you tried with capistrano/bundler
for bundle exec
version?
Yeah.. I ended up having to add
SSHKit.config.command_map[:sidekiq] = "source ~/.bash_profile && bundle exec sidekiq"
SSHKit.config.command_map[:sidekiqctl] = "source ~/.bash_profile && bundle exec sidekiqctl"
to my deploy.rb file.
please check https://github.com/capistrano/rvm/blob/master/lib/capistrano/tasks/rvm.rake#L37-L40 for better solution
bundle exec
is being added only to the commands listed in bundle_bins
.
Here is the solution:
set :bundle_bins, fetch(:bundle_bins, []).push %w(sidekiq sidekiqctl)
@kirs I think you mean rvm_map_bins
. The OPs command is already prefixed with bundle exec
.
Using bundle_bins
by itself doesn't seem to prefix the rvm path/verson when executing a bundled binary.
@OscarBarrett yeah, sorry for the mistake. You can also use both of them, depends what behaviour exactly do you need.
At first I tried to just use
bundle exec sidekiqctl
but since all my other commands seem to need to run in the app's current directory I wrapped my executewithin current_path do ... end
It ends up trying to execute
cd /var/app/current && bundle exec sidekiqctl stop /var/app/shared/tmp/pids/sidekiq.pid
Which works when I copy and paste that on the server logged in as the deploy user.
However, when it runs during capistrano deployment it fails...
bash: bundle: command not found
Here's my restart task code...
Maybe I'm posting to the wrong repo.. but I have a feeling this has something to do with how my RVM is configured.
I have this in my ~/.bash_profile