8

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?

Robin Clowers
  • 2,150
  • 18
  • 28

2 Answers2

15

use:

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

as of at least capistrano 3.1

Mike H-R
  • 7,726
  • 5
  • 43
  • 65
0

Perhaps a bit late but...

Capistrano 3 uses a specia syntax for environment

on roles :app do
  with some_env: "foobar" do
    ...
  end
end

In the above example, within the with/end block capistrano sets the environment variable SOME_ENV to "foobar"

see https://github.com/capistrano/sshkit#users-working-directories-environment-variables-and-umask

theist
  • 3,270
  • 2
  • 22
  • 23