rvm / rvm1-capistrano3

RVM 1.x Capistrano 3.x integration gem
73 stars 34 forks source link

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

Open masarakki opened 8 years ago

masarakki commented 8 years ago

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.

iurifq commented 8 years ago

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} }
masarakki commented 8 years ago

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.

dgarwood commented 5 years ago

@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.