开发者

RVM error with deploying Rails app via Capistrano

开发者 https://www.devze.com 2023-02-16 01:29 出处:网络
History: Read into Deploying Rails3 app to a Mediatemple DV server. Installed RVM on the server, ruby, and essential gems.

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
  expo开发者_JAVA百科rt rvm_selfcontained=0
  export rvm_prefix="/usr/local/"
fi

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


Next time try to add this in your capistrano:

set :rvm_type, :system


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.


I just wanted to add to @imonyse's comment.

the head branch of rvm might be a tad too unstable for some deploys. I know our deprecated SLES boxes have a tendency to choke on it. It might be advisable to get the most recent stable version.

rvm get stable

Also don't do this on a really old server running production code as it may have undesired consequences.

0

精彩评论

暂无评论...
验证码 换一张
取 消