rvm / rvm1-capistrano3

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

/usr/bin/env: bundle : No such file or directory #71

Open xn opened 8 years ago

xn commented 8 years ago

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 on 1.4.0

mczepiel commented 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

xn commented 8 years ago

Sorry, don't remember. Rolling back worked for me. You could step back, commit by commit and see where the error was introduced.

coding-bunny commented 8 years ago

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

xn commented 8 years ago

check .baschrc .bash_profile and .profile and see if the path is set in each.

ujh commented 8 years ago

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.

ResumeNothing commented 8 years ago

Thanks @ujh! Was running into the same problem and setting rvm1_map_bins fixed it.

ResumeNothing commented 8 years ago

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

That's entirely possible. We use a few other Capistrano gems as well.

jeffrey008 commented 7 years ago

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?

ujh commented 7 years ago

What I ended up doing was set rvm1_map_bins directly:

set :rvm1_map_bins, %w(rake gem bundle ruby honeybadger)
bappelt commented 7 years ago

@ujh's solution worked for me as well

hron84 commented 5 years ago

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.

ur5us commented 3 years ago

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