在Mac和Windows上安装了全新的稳定Sass 3.3.0(Maptastic Maple)。使用-f --update sass:css
时它工作正常。但是在使用--watch
时,我得到的是NoMethodError
- 错误。
没有--trace:
C:\RemoteProjects\sass-sourcemaps>sass --style expanded --sourcemap --watch sass:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
NoMethodError:
使用--trace
C:\RemoteProjects\sass-sourcemaps>sass --style expanded --watch ./:../css --trace
>>> Sass is watching for changes. Press Ctrl-C to stop.
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/plugin/compiler.rb:327:in `listen_to': undefined method `thread' for #<Listen::Listener:0x00000003c95d58> (NoMethodError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/plugin/compiler.rb:294:in `watch'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/plugin.rb:108:in `method_missing'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/exec.rb:509:in `watch_or_update'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/exec.rb:346:in `process_result'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/exec.rb:43:in `parse'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/lib/sass/exec.rb:22:in `parse!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.0/bin/sass:13:in `<top (required)>'
from C:/Ruby200-x64/bin/sass:23:in `load'
from C:/Ruby200-x64/bin/sass:23:in `<main>'
有人有任何想法吗?我们确实需要--watch
功能进行本地开发。
答案 0 :(得分:5)
感谢Jose Gonzalez链接的https://github.com/nex3/sass/issues/1151页面。如该页面所述,修复方法是删除listen
v2.7.0 gem并恢复为listen
v2.4.1 gem。
在Mac上,使用sudo
gem update sass
listen
gem,运行: gem list
listen
v2.7.0 AND v2.4.1,那么您需要卸载较新的listens
gem。然后它将使用v2.4.1。 gem uninstall listen --version '2.7.0'
这对我有用。 Sass 3.3.0 --watch
命令现在正常运行。
答案 1 :(得分:0)
根据我之前评论中链接的错误报告,似乎已经在Sass v3.3.1中解决了这个问题: