Last Updated: May 17, 2017
·
2.621K
· craigmcnamara

Setting Ruby Version in Capistrano 3

Rbenv, RVM, Chruby? Nope, you don't need it.

In your deploy.rb do something like this:

set :ruby_version, '/usr/local/ruby200/bin'

set :default_env, -> {{ path: [fetch(:ruby_version), "#{release_path}/bin", "$PATH"].join(":") }}

That will setup your path so that you're using the desired ruby on deploy and setup of your app.

Simple.