RVM - System Wide Installs and Capistrano Integration

If you install RVM on server, mostly probably will choose run as System wide, since there is more than one account will use ruby. then the problem is when you use Capistrano deploy your application it will also say: can't find bundle, although you've installed the ruby on your server. So you need to add below lines to your deploy.rb file. require "bundler/capistrano" $:.unshift(File.expand_path("./lib", ENV["rvm_path"]))
require 'rvm/capistrano'
set :rvm_ruby_string, 'some-ruby-version' # Defaults to 'default'
set :rvm_type, :system or :user 
set :rvm_bin_path, "xxx" 
Then when you run command on server you can do like this:
run "cd #{release_path}; bundle install"
Doesn't need do like:
run "cd #{release_path}; /full/path/to/bundle install"
You also can use: cap shell to test it out if it is possible to run the command on different server. Reference article: http://blog.ninjahideout.com/posts/rvm-system-wide-installs-and-capistrano-integration
blog comments powered by Disqus