Closed abacha closed 6 years ago
I have the same issue with mina-sidekiq.
I have the same issue with mina deploy
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 -)"
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.
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)
I am write in config/deploy.rb invoke :'rvm:use', 'ruby-2.2.5@default'
before task :environment
.
it works for me)
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.
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.
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?
I solved it this way:
task :deploy do
deploy do
invoke :'rbenv:load'
...
end
...
end
For rbenv.
@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
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
Every command that invokes "bundle" throw this error: "bash: bundle: command not found" Im using v1.0.6