Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

EACCES Error on Compass watch #1497

Closed rpkoller closed 10 years ago

rpkoller commented 10 years ago

I am running osx 10.8.5. with gem version 1.3.6 and ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]. Today i've removed all local gems. Afterwards i wanted to give thh Sass and Compass prerelease versions a spin alongside a certain gem. I've installed:

sudo gem install compass --pre
sudo gem install modular-scale --pre

The local gem list looks like that:

*** LOCAL GEMS ***

chunky_png (1.2.9)
compass (1.0.0.alpha.17)
compass-core (1.0.0.alpha.16)
compass-import-once (1.0.2)
ffi (1.9.3)
fssm (0.2.10)
json (1.8.1)
listen (1.1.6)
modular-scale (2.0.0.alpha3)
multi_json (1.8.2)
rb-fsevent (0.9.3)
rb-inotify (0.9.3)
rb-kqueue (0.2.0)
sass (3.3.0.rc.2)

But when i tried "compass watch" on a sample sass snippet i've received an error like in an previous alphas descibred in the issue here: https://github.com/chriseppstein/compass/issues/1406 . It's just odd that it happens on a "clean install" here. i've performed a compass watch --trace afterwards:

[danton@localhost][testung 2] compass watch --trace
>>> Compass is watching for changes. Press Ctrl-C to Stop.
/Users/danton/Desktop/Testung 2/scss/style.scss:6 DEBUG: 67.5px
identical css/style.css 
Errno::EACCES on line 1039 of /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb: Permission denied - /Library/Ruby/Gems/1.8/gems/compass-core-1.0.0.alpha.16/stylesheets/.listen_test
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1039:in `open'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1039:in `touch'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1033:in `each'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1033:in `touch'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:221:in `works?'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `usable_and_works?'
  /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `all?'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `each'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `all?'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `usable_and_works?'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:49:in `send'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:49:in `select_and_initialize'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `each'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `select_and_initialize'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/listener.rb:272:in `initialize_adapter'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/listener.rb:264:in `setup'
  /Library/Ruby/Gems/1.8/gems/listen-1.1.6/lib/listen/listener.rb:64:in `start!'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/lib/compass/watcher/project_watcher.rb:31:in `watch!'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/lib/compass/commands/watch_project.rb:48:in `perform'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/lib/compass/commands/base.rb:18:in `execute'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/lib/compass/commands/project_base.rb:19:in `execute'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/lib/compass/exec/sub_command_ui.rb:15:in `run!'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/bin/compass:30
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/bin/compass:44:in `call'
  /Library/Ruby/Gems/1.8/gems/compass-1.0.0.alpha.17/bin/compass:44
  /usr/bin/compass:19:in `load'
  /usr/bin/compass:19

If you need any further informations let me know. Best regards Ralf

p.s. and sorry again for the accidental topic only post in the first place.

lolmaus commented 10 years ago

You really should provide more info.

rpkoller commented 10 years ago

sorry i've entered the string in the wrong field. Basically wanted to search the issue tracker first for cross referencing. I am in order of entering the infos right now and then reopen the issue again. Till then i wanted to keep the issue closed to not clutter the issue list. Give me a few more minutes please.

lolmaus commented 10 years ago

Can you try with a modern version of Ruby?

rpkoller commented 10 years ago

ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0] would be ok?

lolmaus commented 10 years ago

Yes. It is likely not the reason for your issue but that's kinda the first thing i would try.

scottdavis commented 10 years ago

I highly recommend using http://bundler.io/ to manage your gem dependencies. Also makes it way to switch to newer/older versions

rpkoller commented 10 years ago

@lolmaus i'll give it a try

@scottdavis i will give it a try after i tried a clean install of compass like described above with ruby 1.9.3 (to have the same setting) . Already read about the recommendation about bundler, but also the flaw that it isn't working with Codekit which prevented me from trying yet.

rpkoller commented 10 years ago

@lolmaus ok as you expected. The error isn't turning up with ruby 1.9.3. the other difference was that with the standard ruby version i've "sudo" installed gems while with ruby 1.9.3 i've just "gem installed" without sudo. Maybe a permissions issues based on the install location.

scottdavis commented 10 years ago

It is 100% a permissions issue not related to compass if you have more issues the proper place for this would be the google group

Sent from my iPhone

On Dec 30, 2013, at 7:25 PM, Ralf Koller notifications@github.com wrote:

@lolmaus ok as you expected. The error isn't turning up with ruby 1.9.3. the other difference was that with the standard ruby version i've "sudo" installed gems while with ruby 1.9.3 i've just "gem installed" without sudo. Maybe a permissions issues based on the install location.

— Reply to this email directly or view it on GitHub.

scottdavis commented 10 years ago

This is an issue with configuring listen

impatient commented 10 years ago

@scottdavis Would this work? I keep all of the compiler paths I believe and just whittle down the actual watched directories.

https://github.com/impatient/compass/commit/75328434a69f159266c8a3976fa2c9aeac5f83d2

scottdavis commented 10 years ago

@impatient I'm not against this and if you would like to submit pr we will review it

pniederlag commented 10 years ago

just to let you know I do have the very same problem. Would be nice if you could review (and merge?) the pull request

chriseppstein commented 10 years ago

In Sass 3.3 I added a new method to importers: https://github.com/nex3/sass/blob/master/lib/sass/importers/base.rb#L148-L155

So all we need to do is iterate over the normalized load paths and accumulate the directories_to_watch.

Note also, that listen really dislikes it if you watch a subdirectory of a watched directory. You will get multiple events for the same change. So it's important to remove those entries like so: https://github.com/nex3/sass/blob/master/lib/sass/plugin/compiler.rb#L327-L342

Note that I really want to switch compass over to Sass's watcher. In 3.3 I rewrote the Sass watcher with this in mind. So I don't really care if this code is perfect, as it will probably go away soon.

impatient commented 10 years ago

Question about the pull request. I removed the framework stylesheets directory from the list of directories to watch. Does this make sense?

Is there a case where the framework directories should need to be watched?

Here it is trying to listen to:
/Library/Ruby/Gems/1.8/gems/compass-core-1.0.0.alpha.16/stylesheets/

Would it be better to determine file rights and do a poll there if necessary and write a warning?

I'll clean up the pull request to not duplicate code, with the expectation that it will be rewritten at some point.

impatient commented 10 years ago

Updated commit assuming the answer to the following question is no.

Is there a case where the framework directories should need to be watched?
Bobz-zg commented 10 years ago

To me works with: sudo compass watch

Yokocapolo commented 10 years ago

I am having the same issue. I am on ruby version 2.0.0p247 (2013-06-27 revision 41674), but my error was on line 1143 rather then 1039 as @rpkoller shows. Here is my trace:-

$ compass watch My\ Website/ --trace
Compass is watching for changes. Press Ctrl-C to Stop.
    error sass/style4.sass (Line 7: Invalid CSS after "() ": expected expression (e.g. 1px, bold), was "{")
identical stylesheets/style4.css 
Errno::EACCES on line ["1143"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb: Permission denied - /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.17/stylesheets/.listen_test
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1143:in `open'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1143:in `rescue in block in touch'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1139:in `block in touch'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1137:in `each'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1137:in `touch'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:221:in `works?'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `block in usable_and_works?'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `each'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `all?'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `usable_and_works?'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:49:in `block in select_and_initialize'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `each'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `select_and_initialize'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/listener.rb:272:in `initialize_adapter'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/listener.rb:264:in `setup'
  /Library/Ruby/Gems/2.0.0/gems/listen-1.1.6/lib/listen/listener.rb:64:in `start!'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/watcher/project_watcher.rb:31:in `watch!'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/commands/watch_project.rb:48:in `perform'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/commands/base.rb:18:in `execute'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/commands/project_base.rb:19:in `execute'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/lib/compass/exec/sub_command_ui.rb:15:in `run!'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/bin/compass:30:in `block in <top (required)>'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/bin/compass:44:in `call'
  /Library/Ruby/Gems/2.0.0/gems/compass-1.0.0.alpha.18/bin/compass:44:in `<top (required)>'
  /usr/bin/compass:23:in `load'
  /usr/bin/compass:23:in `<main>'

And using sudo as @Bobz-zg states allows me to watch my project without error.

hitmands commented 10 years ago

yep, works with 'sudo bundle exec compass watch', but seems not good way! Help US!

egstad commented 10 years ago

Still no solution other than running a sudo command? I have the same problem, and the symptoms of whatever problem this is sure makes working in the command line a pain.

impatient commented 10 years ago

What version are you running? He added a check for whether or not a directory was writable in the commit above. I'd expect it to work.

 dirs.select! {|d| File.writable?(d) }

You could also add the --poll flag to get up and running or install a ruby that doesn't place your gem directories somewhere read only.

ddbrierton commented 10 years ago

This is not working for me. I had been sticking with Sass 3.2 and Compass 0.12 until today, when I upgraded to compass-1.0.0.alpha.21 and sass-3.3.10. This is on Mac OS X 10.9.4, with the system version of Ruby (2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]).

$ gem list | egrep 'compass|sass' compass (1.0.0.alpha.21) compass-core (1.0.0.alpha.21) compass-import-once (1.0.4) compass-normalize (1.5) sass (3.3.10)

$ compass watch .

Compass is watching for changes. Press Ctrl-C to Stop. Errno::EACCES on line ["1144"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb: Permission denied - /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.21/stylesheets/.listen_test Run with --trace to see the full backtrace

(I’m thinking the trace is unnecessary at this stage as the problem seems to be understood, but I will provide one if necessary.)

tylertadej commented 10 years ago

@jordanegstad a quick way to avoid 'sudo' is to go to the directory '/Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.21/' and give yourself read/write access on that folder and all enclosed folders.