我正在使用vim进行项目,每次保存.scss文件时,都会出现以下错误:
Deleted template detected: /home/path/to/my.scss
/usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/plugin/compiler.rb:338:in `read': No such file or directory - public/stylesheets/my.scss (Errno::ENOENT)
from /usr/lib/ruby/gems/1.8/gems/listen-0.4.2/lib/listen/adapters/linux.rb:34:in `join'
from /usr/lib/ruby/gems/1.8/gems/listen-0.4.2/lib/listen/adapters/linux.rb:34:in `start'
from /usr/lib/ruby/gems/1.8/gems/listen-0.4.2/lib/listen/multi_listener.rb:44:in `start'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/plugin/compiler.rb:306:in `watch'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/plugin.rb:107:in `send'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/plugin.rb:107:in `method_missing'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/exec.rb:431:in `watch_or_update'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/exec.rb:302:in `process_result'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/exec.rb:41:in `parse'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/../lib/sass/../sass/exec.rb:21:in `parse!'
from /usr/lib/ruby/gems/1.8/gems/sass-3.1.17/bin/sass:8
from /usr/bin/sass:19:in `load'
from /usr/bin/sass:19
思考?如果我每次手动重启--watch服务器,它都有效,但这有点违背它的精神。
答案 0 :(得分:-2)
你应该完全使用Compass!
指南针是每个SASS编码器必备的工具。指南针由两部分组成:
compass watch
命令正是您所需要的。只要保存更改,它就会重新编译CSS,就像sass --watch
一样。 删除SASS / SCSS文件时不会失败,除非您保留@import
个已删除的文件。
要使以下工作,您必须拥有Ruby和RubyGems。当您使用sass
命令行工具时,可能已经拥有它们。
要开始使用Compass,请执行以下操作:
gem install compass
。compass.rb
文件(在您的情况下为Project/compass.rb
)。compass watch
并开始编码。这是一个可能适合您的最小compass.rb
:
css_dir = "stylesheets"
sass_dir = "sass"