I'm using bash, and my bashrc file isn't getting loaded. But I also
can't seem to set the environment variables via run commands in a task
that gets fired off before any other actions.
I have the following task:
task :env_dump, :roles => :app do
run "ORACLE_HOME=/opt/oracle/instantclient_10_2"
run "echo $ORACLE_HOME"
run "echo $PATH"
end
The path gets echoed out, but nothing gets spit out after the echo
$ORACLE_HOME line. I've also tried executing a script which sets the
environment, but that doesn't seem to work either. Until I can properly
set the environment variables, deployment needs to be done manually by
logging in (where the environment does get set up as soon as I login
via my .bashrc file).
Has anyone else seen this? Has anyone been able to get around it?
First, I monkeypatched Capistrano as mentioned in the earlier thread:
capistrano, .bashrc, Debian and RedHat
http://groups.google.com/group/capistrano/browse_thread/thread/a59ce635c15d41d4
Next I had to set :use_sudo to false in my deploy.rb:
set :use_sudo, false
Both of these together seem to work (but it seems a little ugly).