I was having a failed: "sh -c 'cd /var/www
error. Then fixed it by adding the following in deploy.rb...
set :default_environment, {
'PATH' => "/var/lib/gems/1.9.1/bin:$PATH"
}
Now I'm getting this new error.
** [out :: ip.address] Rails Error: Unable to access log file. Please ensure that /var/www/releases/20111208152807/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
** [out :: ip.address] mkdir -p /var/www/releases/20111208152807/public/assets
** [out :: ip.address] mkdir -p /var/www/releases/20111208152807/public/assets
** [out :: ip.address] mkdir -p /var/www/releases/20111208152807/public/assets
** [out :: ip.address]
** [out :: ip.address] mkdir -p /var/www/releases/20111208152807/public/assets
** [out :: ip.address] mkdir -p /var/www/releases/20111208152807/public/assets
** [out :: ip.address]
** [out :: ip.address] rake aborted!
** [out :: ip.address]
** [out :: ip.address] Permission denied - /var/www/releases/20111208152807/public/assets/manifest.yml
So I checked the permissions on manifest.yml and production.log with ls -lha and yes, they're owned by root.
The capistrano deployment is being done by a linux user (not root) that owns the /var/www directory. I'm guessing it's because whatever command is creating those files is giving them root ownership.
CLARIFICATION: I know that probably just deploying using root will fix the problem but I don't want to use root.