Open Rudikza opened 9 years ago
Ok so the problem here is that rvm1-capistrano3 is not setting rvm1_map_bins correctly when used with capistrano-puma.
Capistrano-puma sets rvm_map_bins to ["puma", "pumactl'] and then rvm1-capistrano3 uses the following code to merge what ever is in rvm_map_bins with "rake", "gem", "bundle", "ruby".
set :rvm1_map_bins, -> { fetch(:rvm_map_bins, %w{rake gem bundle ruby}) }
The problem is that it only returns back what is already in rvm_map_bins and does not append the new string elements in the array.
For example:
pry(main)> set(:rvm_map_bins, %w{peach apple})
=> ["peach", "apple"]
pry(main)> fetch(:rvm_map_bins, %w{rake gem bundle ruby})
=> ["peach", "apple"]
One way to do this would be to use the same method as capistrano-puma by doing a to_a.concat
pry(main)> set(:rvm_map_bins, %w{grape banana})
=> ["grape", "banana"]
pry(main)> fetch(:rvm_map_bins).to_a.concat(%w{ rake gem bundle ruby })
=> ["grape", "banana", "rake", "gem", "bundle", "ruby"]
So the new code in lib/rvm1/tasks/capistrano3.rake:41 would look like this:
set :rvm1_map_bins, -> { fetch(:rvm_map_bins).to_a.concat(%w{ rake gem bundle ruby }) }
I would be happy to write the code, just let me know if you are happy with this way of doing it?
Hi,
I am trying to use rvm1-capistrano3 on a Centos server which already has system ruby installed. The system ruby is needed by the sysadmin for puppet and he has asked that I dont mess with it.
The problem is that most capistrano tasks use /usr/bin/env and when that happens it defauls to the system, ruby 2.0.0p598, instead of the specified version of jruby-9.0.1.0.
Here is the output from
cap staging rvm1:check
The problem here is that /usrbin/env is using ruby 2.0.0p598 instead of jruby.
I have tried using 'rvm1:hook' but that doesn't seem to make a difference.
Is there some way to force all commands to use rvm-auto.sh instead of /usr/bin/env or am I holding this thing wrong?