Skip to content

Capistrano

postmodern edited this page Jan 7, 2013 · 7 revisions

chruby can be used with Capistrano to select a specific Ruby when deploying.

Capfile

default_run_options[:shell] = '/bin/bash'
set :ruby_version, "1.9.3-p327"
set :chruby_config, "/etc/profile.d/chruby.sh"
set :set_ruby_cmd, "source #{chruby_config} && chruby #{ruby_version}"
set(:bundle_cmd) {
  "#{set_ruby_cmd} && exec bundle"
}
Clone this wiki locally