Matilda Yi Pan Matilda Yi Pan - 4 months ago 17
Sass (Sass) Question

sass can be converted to css, but not working with watch command

everyone, I am SASS beginner, just started to learn Sass. So, this question may seemed ridiculous to someones.

Here, I got style.scss

$myColor: #009a82;
$myString: " some text here ";
$myFontSize: 13px;
$myMargin: 0px auto;
$myWidth: 460px;

h1 {
color: $myColor;
margin: 0;
padding: 0;
}

#container {
width: $myWidth;
margin: $myMargin;
}


when I use command


sass style.scss style.css


I can get a css file:

h1 {
color: #009a82;
margin: 0;
padding: 0; }

#container {
width: 460px;
margin: 0px auto; }


However, when I use command


sass --watch Sass:style


I got :

/*
Error: Invalid property: "Backtrace:" (no value).
on line 4 of Sass

1: /*
2: Errno::ENOENT: No such file or directory @ rb_sysopen - Sass
3:
4: Backtrace:
5: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:482:in `read'
6: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:482:in `update_stylesheet'
7: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
8: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:209:in `each'
9: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'

Backtrace:
Sass:4
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:719:in `parse_property'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:681:in `parse_property_or_rule'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:647:in `parse_line'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:525:in `build_tree'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:544:in `block in append_children'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:543:in `each'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:543:in `append_children'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:396:in `_to_tree'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:368:in `_render_with_sourcemap'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/engine.rb:285:in `render_with_sourcemap'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:490:in `update_stylesheet'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:209:in `each'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:293:in `watch'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin.rb:108:in `method_missing'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/exec/sass_scss.rb:370:in `watch_or_update'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/exec/sass_scss.rb:50:in `process_result'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/exec/base.rb:52:in `parse'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/exec/base.rb:19:in `parse!'
C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/bin/sass:13:in `<top (required)>'
C:/Ruby21/bin/sass:23:in `load'
C:/Ruby21/bin/sass:23:in `<main>'
*/
body:before {
white-space: pre;
font-family: monospace;
content: "Error: Invalid property: \"Backtrace:\" (no value).\A on line 4 of Sass\A \A 1: /*\A 2: Errno::ENOENT: No such file or directory @ rb_sysopen - Sass\A 3: \A 4: Backtrace:\A 5: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:482:in `read'\A 6: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:482:in `update_stylesheet'\A 7: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'\A 8: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:209:in `each'\A 9: C:/Ruby21/lib/ruby/gems/2.1.0/gems/sass-3.4.9/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'"; }


Anyone can tell me why?
Do I use the "watch" command in a wrong way?

Many thanks.

Answer

Try using sass --watch style.scss:style.css

Comments