Open xn opened 8 years ago
Hmm, having the same problem. Rolling back rvm1-capistrano3 alone doesn't seem to get things working again, so I'l have to go through my Gemfile.lock
and compare some of the other recent updates I've made e.g. capistrano-rails, capistrano-bundler, ssh-kit, etc.
Posting mainly to ask if you had any luck getting this going on 1.4.0
Sorry, don't remember. Rolling back worked for me. You could step back, commit by commit and see where the error was introduced.
running into the same issue, and noticed when running console and then echoing PATH, that RVM is no longer included. But when ssh'ing on the box myself, I have RVM in the PATH again
check .baschrc .bash_profile and .profile and see if the path is set in each.
On further investigation (I'm a coworker of @NekoNova) I noticed the following. On 1.3.2.2 I could see Capistrano using the rvm-auto.sh
script to execute the various executables. But with 1.4.0 those were missing. It turns out that when I set rvm1_map_bins
by hand:
set :rvm1_map_bins, %w{rake gem bundle ruby}
It works just fine.
Thanks @ujh! Was running into the same problem and setting rvm1_map_bins
fixed it.
it looks like the issue is that other capistrano gems are setting rvm_map_bins
, which is causing it to never get populated with the defaults. For example, capistrano-puma has the following:
set :rvm_map_bins, fetch(:rvm_map_bins).to_a.concat(%w{ puma pumactl })
Here's the relevant line from rvm1_capistrano3, capistrano3.rake:
set :rvm1_map_bins, -> { fetch(:rvm_map_bins, %w{rake gem bundle ruby}) }
Perhaps we need something like this?
set :rvm1_map_bins, -> { fetch(:rvm_map_bins).to_a.concat(%w{rake gem bundle ruby}).uniq }
That's entirely possible. We use a few other Capistrano gems as well.
I am running into the same problem today.
Adding gem 'capistrano-rvm'
in Gemfile, run bundle
, then add require 'capistrano/rvm'
in Capfile
solves the problem for me.
If you have already solved it, would you mind posting your solution?
What I ended up doing was set rvm1_map_bins
directly:
set :rvm1_map_bins, %w(rake gem bundle ruby honeybadger)
@ujh's solution worked for me as well
For make it work with latest capistrano/bundler
, do the following:
append :rvm_map_bins, 'gem', 'ruby', 'bundle'
after 'bundler:map_bins', 'rvm1:hook'
It inserts rvm hooks just right before any bundler command can be used. It ensures the correct ruby will run bundler commands.
Just ran into this issue also. For me, a slightly modified version of @hron84’s solution worked, basically only using the append …
line. For reference, here’s the entire contents of my Capfile
as the problem seems to stem from which Capistrano plugins one’s using:
require "capistrano/setup"
require "capistrano/deploy"
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
require "rvm1/capistrano3"
require "capistrano/rails"
require 'capistrano/puma'
install_plugin Capistrano::Puma
require "whenever/capistrano"
require "rollbar/capistrano3"
require "thinking_sphinx/capistrano"
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
…and deploy.rb
:
# frozen_string_literal: true
lock "~> 3.14.0"
set :application, "…"
set :repo_url, "…"
set :default_stage, "staging"
set :user, "deploy"
set :deploy_to, -> { "/srv/www/#{fetch :application}" }
append :rvm1_map_bins, :rake, :gem, :bundle, :ruby
# …more configuration
INFO [817dfa13] Running /usr/bin/env bundle install --path /home/ubuntu/apps/lesson/shared/bundle --without development test --deployment --quiet on XXXXXXXXXXXXX DEBUG [817dfa13] Command: cd /home/ubuntu/apps/lesson/releases/20160127174421 && /usr/bin/env bundle install --path /home/ubuntu/apps/lesson/shared/bundle --without development test --deployment --quiet DEBUG [817dfa13] /usr/bin/env: bundle DEBUG [817dfa13] : No such file or directory
This works fine on
1.3.2.2
, breaks on1.4.0