Capistrano: Can I set an environment variable for the whole cap session?

后端 未结 5 801
遇见更好的自我
遇见更好的自我 2020-11-29 02:29

I\'ve got a staging server with both standard Ruby and Ruby Enterprise installed. As standard Ruby refuses to install a critical gem, I need to set $PATH so that ruby/gem/r

5条回答
  •  情书的邮戳
    2020-11-29 02:49

    I have the exactly same problem, but I think this solution is better:

    set :default_environment, { 
      'env_var1' => 'value1',
      'env_var2' => 'value2'
    }
    

    This works for me like a charm.

提交回复
热议问题