Rails sprocket CSS assest compilation error - CHOWN problem

I’ve been racking my brains over this for more than two days and can’t understand where the problem is. This is mainly a problem related to my installation, but if anyone can help me find a solution to this problem, then I will be his slave for eternity ..!

I am running Snow leopard (host) and VMware fusion, starting the Ubuntu Lucid server (guest OS). Somehow, after many headaches, I managed to get my workspace from Mac to Ubuntu. Thus, in fact, I was able to isolate my dev environment on a virtual machine, which simplifies the work of the entire development team in the same environment regardless of their OS / host installation, etc. Although this certainly made things simpler, I was stuck with a specific problem due to asterisks (I think). Every time I make changes to the stylesheets and reloads, I get this error:

Error compiling CSS asset Errno::EPERM: Operation not permitted - /mnt/hgfs/banjarey/tmp/cache/assets/DCF/780/sprockets%2F5f78b3457def1d02bd3fb75d4e0cfb63 /home/coderboy/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/core_ext/file/atomic.rb:38:in `chown' 

The fact is that if I reload the page twice or thrice, compiling css and everything will be fine.

This is a real shame for reloading the page twice or thrice for every css change I make. I played a bit with memberships and permissions, but was an amateur whom I did not know deeply enough, I think.

Any ideas from people?

+6
source share
4 answers

I have the same problem. my solution is to change the file resolution after the precompile assets:

 #chown apache.root yourapp -R #chmod 755 yourapp -R 
+2
source

A bit late with this answer, but chmod every time the application is deployed does not seem to be a good solution. I think the problem is with your apache instance and your passenger instance is working as different users. So the solution is to check which user is working with your Apache server and install PassengerDefaultUser.

For instance:

PassengerDefaultUser www-data p>

It worked for me. Since Passenger made files read-only, it’s strange that if you just update several times, some of them work, but making sure that they are the same users stop this error.

+2
source

I experienced the same error, but in development! It is solved after cleaning and recompiling the assets:

  rake assets:clean && rake assets:precompile 
+1
source

Verify that the underlying file system supports the requested operation. The following commands fixed this for me.

 mv public/assets /tmp ln -s /tmp/assets public/assets 
0
source

Source: https://habr.com/ru/post/898079/


All Articles