cap deploy - RVM not found

1.8k views Asked by At

I get this log:

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as 
[email protected]: rvm exit status: 127
rvm stdout: bash: /home/ubuntu/.rvm/bin/rvm: No such file or directory
rvm stderr: Nothing written


Caused by:
SSHKit::Command::Failed: rvm exit status: 127
rvm stdout: bash: /home/ubuntu/.rvm/bin/rvm: No such file or directory
rvm stderr: Nothing written

Tasks: TOP => rvm:check
(See full trace by running task with --trace)

After performing cap production deploy. The point is, that RVM is installed there, in the exact path it is looking for.

Please advice.

3

There are 3 answers

5
Peter P On

Probably you need to add rvm to PATH variable. Otherwise capistrano can not find it neither you can run it from CLI.

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Add this lines in your home directory's .bashrc file. Make sure to restart the session or source .bashrc.

0
bobomoreno On

I had to do this in the end to resolve this (took hours):

ln -s /usr/share/rvm/bin/rvm .rvm/bin/rvm
0
Rabin Poudyal On

This should work

set :rvm_custom_path, '/usr/share/rvm'
set :rvm_bin_path, '/usr/share/rvm/bin/rvm'