问题
I'm using Sass and Compass (on osx) and using "compass watch" to compile my .scss files. The compilation runs OK, in that the .css files are created with the correct content. However, looking at the permissions shows that the file is written with the "Everyone" group as having "No Access" resulting in the css not appearing on the page. When I correct the permissions manually all is well again, but any subsequent saves result in compass overwriting the file with "No access" permissions again.
I'm not sure whether the problem here is with my config.rb (but I don't think so), or the permissions within the sass subdirectories. I've deleted .sass-cache and repeated the setup. How does compass derive its write permissions?
Any help would be greatly appreciated.
Thanks, Steve
回答1:
Although not a solution, the test for whether Compass, Sass, directory permissions were at fault was to create a new directory entirely outside of the project structure and run the following in the terminal for that project
compass create
compass watch
I then checked whether the css files produced had Read permissions.
In my case, they had the expected Read permissions (Everyone: read) so I concluded that it was something related to the directory permission of the original project. As a fix I recreated the directory structure in another location, copied over the files unrelated to CSS/SASS and then began again with compass create, compass watch to generate the css.
I don't believe this was related to the current Sass issue
回答2:
Apparently this is a known issue with a Sass utility as of Compass 0.12.4: https://github.com/chriseppstein/compass/issues/1615#issuecomment-38332287
The Sass fixes are present in the most recent version, but I think we're going to have to wait for Compass 0.12.5.
回答3:
RVM worked as a solution for me.
I was having the same exact problem using the native Ruby install on OS X Mavericks. Like you, I tried the method of creating an independent test compass project outside of the working project directory where I originally encountered this same issue. Compass still generated css files inaccessible to all others.
The solution for me was to install RVM and Ruby v.2.1.1. Then I installed Compass the normal way and didn't even need to do so with sudo.
This is just an uneducated guess but maybe installing and running gems through the native Ruby either just doesn't jive with the non-system user, or version 2.0.0 has permissions issues with Compass 0.12.4.
来源:https://stackoverflow.com/questions/22581861/compass-sass-writing-files-with-no-access-permissions-for-everyone-group-on-os