Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM error with deploying Rails app via Capistrano

Tags:

History:

  • Read into Deploying Rails3 app to a Mediatemple DV server.
  • Installed RVM on the server, ruby, and essential gems.
  • Site works fine if I FTP it up.
  • All good.

I then decided to do a proper deployment and setup for GIT/cap deploy as per "Agile Web Development with Rails".

  • Attempted deploy with cap, but had errors with gems not available to the production site.
  • Read around and realised I should probably go for a system wide RVM install.
  • Removed all gems and RVM.
  • Installed RVM system wide.
  • Error on cap deploy "bash: /home/foo/.rvm/bin/rvm-shell: No such file or directory", which makes sense - there is no .rvm/ in the home directory.
  • Thinking something was hanging over from initially installing RVM to use as a user, I removed the user, deleting the home directory, and recreated the user with permissions.
  • Same error on cap deploy "bash: /home/foo/.rvm/bin/rvm-shell: No such file or directory"

The situation now is:

For foo, .bashrc contains the last line:

[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm' 

When I issue:

type rvm | head -1 

the response is "rvm is a function".

/etc/rvmrc contains

if [[ ! -s "$HOME/.rvm/scripts/rvm" ]]; then   umask g+w   export rvm_selfcontained=0   export rvm_prefix="/usr/local/" fi 

Running out of ideas here, and hoping for some suggestions.

like image 756
Adrian Avatar asked Mar 09 '11 22:03

Adrian


2 Answers

Next time try to add this in your capistrano:

set :rvm_type, :system 
like image 58
mpapis Avatar answered Oct 07 '22 13:10

mpapis


It seems like rvm-shell is not in your rvm install directory. Run this command

rvm get head 

Then you'll get it right in your rvm bin directory.

like image 34
imonyse Avatar answered Oct 07 '22 13:10

imonyse