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
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论