mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.35k stars 491 forks source link

bash: bundle: command not found #528

Closed abacha closed 6 years ago

abacha commented 7 years ago

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

bindiry commented 7 years ago

I have the same issue with mina-sidekiq.

dongfeng676 commented 7 years ago

I have the same issue with mina deploy

gabskoro commented 7 years ago

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 commented 7 years ago

According to https://github.com/Mic92/mina-sidekiq/issues/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 commented 7 years ago

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 commented 7 years ago

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

d4be4st commented 6 years ago

same issue as https://github.com/mina-deploy/mina/issues/513#issuecomment-328018337

designrubenz commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

Can you please check my comment here https://github.com/mina-deploy/mina/issues/528#issuecomment-290365510 and confirm that it's set up correctly?

rubywarlock commented 5 years ago

I solved it this way:

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

For rbenv.

fffx commented 4 years ago

@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 commented 3 years ago

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