问题
I believe this happened after upgrading to Ruby 2.0.0 and then I resintalled my gems needed for compass watch. I also installed Ruby 1.9.1 and installed the gems for compass watch and got the same error. I tried to change the permissions on the file .listen_test, but it doesn't exist.
Here's the --trace:
compass watch --trace
>>> Compass is watching for changes. Press Ctrl-C to Stop.
error sites/all/themes/dr/compass/sass/blog-ie.sass (Line 919 of sites/all/themes/dr/compass/sass/blog.sass: Invalid flag "!important".)
identical sites/all/themes/dr/compass/css/blog-ie.css
error sites/all/themes/dr/compass/sass/blog.sass (Line 919: Invalid flag "!important".)
identical sites/all/themes/dr/compass/css/blog.css
Errno::EACCES on line ["1140"] of /Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/fileutils.rb: Permission denied - /Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/compass-core-1.0.0.alpha.16/stylesheets/.listen_test
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/fileutils.rb:1140:in `open'
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/fileutils.rb:1140:in `rescue in block in touch'
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/fileutils.rb:1136:in `block in touch'
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/fileutils.rb:1134:in `each'
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/fileutils.rb:1134:in `touch'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:221:in `works?'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `block in usable_and_works?'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `each'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `all?'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `usable_and_works?'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:49:in `block in select_and_initialize'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `each'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `select_and_initialize'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/listener.rb:272:in `initialize_adapter'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/listener.rb:264:in `setup'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/listen-1.1.6/lib/listen/listener.rb:64:in `start!'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/lib/compass/watcher/project_watcher.rb:31:in `watch!'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/lib/compass/commands/watch_project.rb:48:in `perform'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/lib/compass/commands/base.rb:18:in `execute'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/lib/compass/commands/project_base.rb:19:in `execute'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/lib/compass/exec/sub_command_ui.rb:15:in `run!'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/bin/compass:30:in `block in <top (required)>'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/bin/compass:44:in `call'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/gems/compass-1.0.0.alpha.17/bin/compass:44:in `<top (required)>'
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/bin/compass:23:in `load'
/Users/ejohnson/.rvm/rubies/ruby-1.9.3-p484/bin/compass:23:in `<main>'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:15:in `eval'
/Users/ejohnson/.rvm/gems/ruby-1.9.3-p484@global/bin/ruby_executable_hooks:15:in `<main>'
Here are my local gems:
*** LOCAL GEMS ***
bigdecimal (1.1.0)
breakpoint (2.3.1)
bundler (1.3.5)
bundler-unload (1.0.2)
chunky_png (1.2.9)
compass (1.0.0.alpha.17, 0.12.2)
compass-core (1.0.0.alpha.16)
compass-import-once (1.0.1)
compass-rgbapng (0.2.1)
executable-hooks (1.2.6)
ffi (1.9.3)
fssm (0.2.10)
io-console (0.3)
json (1.5.5)
listen (1.1.6)
minitest (2.5.1)
multi_json (1.8.2)
rake (0.9.2.2)
rb-fsevent (0.9.3)
rb-inotify (0.9.3)
rb-kqueue (0.2.0)
rdoc (3.9.5)
rubygems-bundler (1.4.2)
rvm (1.11.3.8)
sass (3.3.0.rc.2, 3.2.12)
susy (1.0.9)
EDIT I got compass watch working by installing an older version of compass (0.12.2)
回答1:
I found it to work with:
sudo compass watch
I'm not sure why now I need the sudo.
回答2:
You have the older version of one of the gems. I would guess it is 'listen'
Someone opened an issue with the same problem.
https://github.com/chriseppstein/compass/issues/1497
Edit: Actually this might be a compass issue. Made some local changes and got beyond the error. Pull request posted pending review. I don't do ruby, but hopefully it's a start to get it resolved. https://github.com/chriseppstein/compass/pull/1522
来源:https://stackoverflow.com/questions/20621062/compass-watch-command-is-erroring-out-when-trying-to-access-compass-core-1-0-0-a