开发者

Ruby on Rails assets:precompile ownership

开发者 https://www.devze.com 2023-04-09 20:06 出处:网络
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 app

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

0

精彩评论

暂无评论...
验证码 换一张
取 消