Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xn opened this issue Jan 27, 2016 · 13 comments
Open

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

xn opened this issue Jan 27, 2016 · 13 comments

Comments

@xn
Copy link

xn commented Jan 27, 2016

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
Copy link

mczepiel commented Feb 6, 2016

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
Copy link
Author

xn commented Feb 6, 2016

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
Copy link

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
Copy link
Author

xn commented Feb 12, 2016

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

@ujh
Copy link

ujh commented Feb 15, 2016

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
Copy link

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

@ResumeNothing
Copy link

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
Copy link

ujh commented Feb 15, 2016

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

@jeffrey008
Copy link

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
Copy link

ujh commented Oct 31, 2016

What I ended up doing was set rvm1_map_bins directly:

set :rvm1_map_bins, %w(rake gem bundle ruby honeybadger)

@bappelt
Copy link

bappelt commented Nov 7, 2016

@ujh's solution worked for me as well

@hron84
Copy link

hron84 commented Sep 2, 2019

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
Copy link

ur5us commented Oct 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants