Skip to content
New issue

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

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

Already on GitHub? # to your account

bash: bundle: command not found #528

Closed
abacha opened this issue Mar 14, 2017 · 13 comments
Closed

bash: bundle: command not found #528

abacha opened this issue Mar 14, 2017 · 13 comments

Comments

@abacha
Copy link

abacha commented Mar 14, 2017

Every command that invokes "bundle" throw this error:
"bash: bundle: command not found"
Im using v1.0.6

@bindiry
Copy link

bindiry commented Mar 16, 2017

I have the same issue with mina-sidekiq.

@dongfeng676
Copy link

I have the same issue with mina deploy

@gabskoro
Copy link
Member

Are you sure you installed bundler on your server for your current ruby version?

If you're using rbenv, ssh to you server and type in

rbenv shell PROJECT_RUBY_VERSION
gem install bundler

Also be sure to export this in your .bashrc file, but don't add it after the # If not running interactively, don't do anything check because mina is not running interactively

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

@zacheryph
Copy link

According to Mic92/mina-sidekiq#18 this is due to a sub shell spawning and not loading rvm/rbenv. I didn't dig into detail. Id rather not initialize rbenv in .bashrc. Im pretty sure there is zero point in mina having "support" if it gets loaded in .bashrc.

@beastie87
Copy link

beastie87 commented May 4, 2017

I have problem too with rvm

mina -v rake[-T]
cd /home/deploy/current
$ RAILS_ENV="production" bundle exec rake -T
bash: line 1: bundle: command not found
-----> Using RVM environment "ruby-2.2.5@default"

not work Mina, but in ssh is it works)

@beastie87
Copy link

I am write in config/deploy.rb invoke :'rvm:use', 'ruby-2.2.5@default' before task :environment .
it works for me)

@d4be4st
Copy link
Member

d4be4st commented Sep 8, 2017

same issue as #513 (comment)

@d4be4st d4be4st closed this as completed Sep 8, 2017
d4be4st added a commit that referenced this issue Sep 8, 2017
hugopl added a commit to hugopl/reviewit that referenced this issue Feb 20, 2018
@designrubenz
Copy link

Changing the line
task :deploy do
into
task :deploy => :environment do
solved the problem for me.

I am not sure, if this is because I installed a new version of the gem (likely) or because I had changed from rvm to rbenv locally (not so likely).

Also, I don't understand why this fixed the problem.

@koskoci
Copy link

koskoci commented Sep 18, 2018

Using mina 1.2.3 did not fix this for me. Running mina ssh, ruby is not installed. SSHing in w/out using mina, I do have ruby installed and can run bundle exec commands just fine.

Mina is a great tool otherwise but this does not work.

@gabskoro
Copy link
Member

Can you please check my comment here #528 (comment) and confirm that it's set up correctly?

Ajmal added a commit to Ajmal/mina that referenced this issue Nov 10, 2018
- Bump ruby version
- Add gem install bundler. [mina-deploy#594 (comment)](mina-deploy#594) [mina-deploy#528(comment)](mina-deploy#528)
@Ajmal Ajmal mentioned this issue Nov 10, 2018
@rubywarlock
Copy link

rubywarlock commented Nov 25, 2018

I solved it this way:

task :deploy do
  deploy do
    invoke :'rbenv:load'
    ...
  end
  ...
end

For rbenv.

@fffx
Copy link

fffx commented Mar 19, 2020

@designrubenz
Because usually in the environment task you have loaded ruby by rvm or rbenv

invoke :'rvm:use', '@default'

task :deploy => :environment do means run environment task before execute deploy task

see https://stackoverflow.com/questions/7044714/whats-the-environment-task-in-rake

@digaoddc
Copy link

The template already has what you need to run the rbenv.

This is what I did.

require 'mina/rbenv'

task :remote_environment do
  invoke :'rbenv:load'
end

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

No branches or pull requests