Ruby on Rails assets:precompile ownership
I have a Ruby on Rails based site, in which I need to run rake assets:precompile
to get the correct pre-compiled assets. Whenever I run this command, however, everything in the tmp
directory of my application goes back to being owned by root (which is a Very Bad Thing™ as my application requires ownership by the www-data
user)开发者_JAVA百科.
How can I get Rails to quit changing the permissions?
If you run rake assets:precompile
as root
, all files generated by this task will belong to root
. you should run it as www-data
(e.g. with sudo -u www-data), as well as any other task / ruby script / rails console on your production server, to prevent messing up the file permissions. to get things right for now, you should chown -R
your application dir, before continuing
精彩评论