I have a webserver (Nginx) on a raspberry pi and I use capistrano to deploy my website. I'm newbie with Capistrano, but I find it funny.
My problem is that when Capistrano want to remove an old release, it can't because Nginx has written in the cache directory with the user www-data and I have a error: permission denied!
How to fix it?
I hope that I am clear.
Generally speaking, you don't want your web server to write into the Capistrano releases. Otherwise you will run into this problem.
I would suggest one of two workarounds:
/var/nginx/cache/app_name
.For example, assuming the cache is written to a cache
directory at the root of your release, you would tell Capistrano:
set :linked_dirs, fetch(:linked_dirs, []) << "cache"