Ask Your Question

I can't get SASS/Compass to work in /var/www

asked 2013-11-08 14:18:48 -0500

3Joe3 gravatar image

I'm trying to set up SASS and Compass on my test server, located at /var/www.

SASS, Ruby and Compass have all been installed. When I try to create a test folder inside /var/www by typing:

compass create sass-test

I get this:

directory sass-test/ 
Errno::EACCES on line ["247"] of /usr/share/ruby/fileutils.rb: Permission denied - /var/www/html/kba/sass-test
Run with --trace to see the full backtrace

How can I make this work? I'm able to do this in Documents for instance but I can't do it here. I already tried typing sudo before it.

Any ideas?

edit retag flag offensive close merge delete


Thank you very much Felix. I jumped the gun before this was answered and used chmod 777. This was probably stupid. How do I get the permission back to default to try your method?

3Joe3 gravatar image3Joe3 ( 2013-11-08 14:44:54 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-11-08 14:39:21 -0500

Felix Schwarz gravatar image

Very likely this is because of your file system permissions and probably completely unrelated to SASS. The following command should create an empty file but will probably not work as well:

touch /var/www/html/kba/sass-test

First of all, verify the ownership and permissions of /var/www/html/kba/:

ls -lha /var/www/html/kba/

The directory should belong to your user. If your Linux user is "3joe3" the command above should display something like this:

drwxr-xr-x.  3 3joe3 3joe3 4,0K 08. Nov 21:30 sass-test

Probably the owner is different so you can change it:

sudo chown -R 3joe3 /var/www/kba/sass-test

Afterwards the touch command mentioned above should work without problems.

Of course the answer above is just a very quick abbreviation of Linux file system security. Special permissions, ACLs, and SElinux can make it way more complicated but I assume you're just hitting a basic problem. If you have SElinux enabled you can try to disable it (until reboot):

sudo setenforce 0

If SElinux was the culprit the touch command should work now.

edit flag offensive delete link more


Very great answer @felix. But setenforce 0 is a workaround, not a solution to that problem. /:

theonlyandy gravatar imagetheonlyandy ( 2016-12-06 10:15:29 -0500 )edit

@theonlyandy I agree that disabling selinux is just a workaround. This was just meant to check "If SElinux was the culprit" (as a starting point to investigate WHY SElinux is a problem). Sorry if I was not clear enough.

Felix Schwarz gravatar imageFelix Schwarz ( 2017-03-17 03:59:17 -0500 )edit

answered 2013-11-08 15:19:22 -0500

3Joe3 gravatar image

Felix is the man. SOLVED! I reset chmod from 777 to 755 and did exactly what he said and now compass can do its thing. Nice!

edit flag offensive delete link more


just a small comment: This site will work best if you accept the right answer (e.g. check mark besides my one), maybe upvote it and add replies like the one above as a "comment" to my answer. But don't worry: No harm done, just sayin'.

Felix Schwarz gravatar imageFelix Schwarz ( 2013-11-08 17:10:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-11-08 14:18:48 -0500

Seen: 644 times

Last updated: Nov 08 '13