How do I configure capistrano to use my rvm version of Ruby

You have two options:

  1. Enable .ssh environment variables using the PermitUserEnvironment option in your ssh configuration file
  2. Use the capistrano :default_environment setting

For the second option, simply add the following line in your deploy.rb file

set :default_environment, { 
  'PATH' => "/path/to/.rvm/ree-1.8.7-2009.10/bin:/path/to/.rvm/gems/ree/1.8.7/bin:/path/to/.rvm/bin:$PATH",
  'RUBY_VERSION' => 'ruby 1.8.7',
  'GEM_HOME' => '/path/to/.rvm/gems/ree/1.8.7',
  'GEM_PATH' => '/path/to/.rvm/gems/ree/1.8.7' 
}

To get the accurate locations have a look at cat ~/.rvm/default

Leave a Comment

tech