Capistrano: env not setup properly over ssh

Hi,
If I make a Capistrano task like

task :test, :roles => :app do
run “env”
end

It prints something completely different than if I just do

ssh login@host env

I need all my login scripts to run so all my environment vars (including
PATH) are set. All my Capistrano tasks are failing because the paths
are setup properly.

Thanks for the help.

On Mar 28, 2006, at 1:39 PM, Christopher J. Bottaro wrote:

I need all my login scripts to run so all my environment vars
(including
PATH) are set. All my Capistrano tasks are failing because the paths
are setup properly.

If I do

ssh login@host env

I get a very different env than if I log into that box and run env
from the cli. I’m not sure why you’d be getting the full environment
in the former case.

Capistrano basically executes each command in a very basic shell, not
a login shell, which means your PATH and so forth won’t be set. If
you need each command to execute within a fully initialized login
environment, you can try doing something like:

task :test do
run “bash -l -c env”
end

  • Jamis