How do I set environment variables in Capistrano 3?

Robin Clowers picture Robin Clowers · Jun 2, 2014 · Viewed 8.7k times · Source

In Capistrano 2, you could do something like this:

set :default_environment, {
  'PATH' => '$PATH:/opt/rubies/ruby-2.1.1/bin'
}

Is there an equivalent in cap 3?

Answer

Mike H-R picture Mike H-R · Jun 2, 2014

use:

set :default_env, {
  'PATH' => 'PATH=$PATH:/opt/rubies/ruby-2.1.1/bin'
}

as of at least capistrano 3.1