rvm1-capistrano3 icon indicating copy to clipboard operation
rvm1-capistrano3 copied to clipboard

conflict definition of `rvm_map_bins` with other gem (capistrano3-puma)

Open masarakki opened this issue 9 years ago • 3 comments

capistrano-puma3 is defines rvm_map_bins in this code:

namespace :load do
  task :defaults do
    set :rvm_map_bins, fetch(:rvm_map_bins).to_a.concat(%w{ puma pumactl })
  end
end

and rvm1-capistrano3 defines:

namespace :load do
  task :defaults do
       set :rvm1_map_bins,   -> { fetch(:rvm_map_bins, %w{rake gem bundle ruby}) }
  end
end

so, when capistrano load defaults with order of capistrano3-puma -> rvm1-capistrano3, rvm1_map_bins will be only ['puma', 'pumactl'] and bundle install will fail.

masarakki avatar Oct 29 '15 08:10 masarakki

I experienced the very same issue. The bundler bundler:install task fails with /usr/bin/env: bundle: No such file or directory

For now, I'm manually setting the rvm1_map_bins

set :rvm1_map_bins,   -> { %w{rake gem bundle ruby} }

iurifq avatar Nov 03 '15 11:11 iurifq

I don't want to set :rvm_map_bins myself, becase I must understand what bins exist in all gems. so I think it is better that rvm1-capistrano3 define it like capistrano3-puma,

    set :rvm1_map_bins, -> { fetch(:rvm_map_bins).to_a.concat(%w{rake gem bundle ruby}) }

but, off cause, it is not a best way... it is completely shit code.

masarakki avatar Nov 03 '15 12:11 masarakki

@masarakki list these like so in your Capfile:

require 'capistrano/rails'
require 'capistrano/bundler'
require 'rvm1/capistrano3'
...
require 'capistrano/puma'

That's the config I have and there isn't an issue with these two working together. This ensures that rvm1/capistrano3 sets the variable first and that capistrano/puma adds to it without being overwritten.

dgarwood avatar Apr 02 '19 19:04 dgarwood