Sass problem when I use the --watch option

When i execute the line

$sass --watch sass/views.scss:views.css 

I get the following message

Sass is following the changes. Press Ctrl-C to stop. NameError: uninitialized constant Listen :: MultiListener Use -trace for backtrace.

As you can tell, the process stops immediately and the view function does not work.

What is the problem here? I installed Ruby version 2.0.0-p0.

Any help was appreciated.

EDIT: (--trace)

Sass is following the changes. Press Ctrl-C to stop. /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/plugin/compiler.rb:66:in watch': uninitialized constant Listen::MultiListener (NameError)
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/plugin.rb:107:in
watch': uninitialized constant Listen::MultiListener (NameError)
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/plugin.rb:107:in
watch': uninitialized constant Listen::MultiListener (NameError)
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/plugin.rb:107:in
method_missing '
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:452:in watch_or_update'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:315:in
watch_or_update'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:315:in
watch_or_update'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:315:in
process_result '
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:41:in parse'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:21:in
parse'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:21:in
parse'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/lib/sass/exec.rb:21:in
parse! ''
from /home/javier/.rvm/gems/ruby-2.0.0-p0/gems/sass-3.2.8/bin/sass:9:in <top (required)>'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in
<top (required)>'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in
<top (required)>'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in
download '
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in ``

+6
source share
4 answers

I tried these answers and nobody worked, so I did some more research. Apparently, the problem is with the listen stone, which uses SASS. Sass is compatible only with listening 0.7.

I managed to get it to work by running the following two commands (as root):

 gem uninstall listen gem install listen -v 0.7.3 
+12
source

I had the same problem. You just need to run the command in sudo mode.

 sudo sass --watch sass/views.scss:views.css 
+5
source

I fixed it by removing the original sass, which I installed using apt-get (ruby-sass) and reinstalled using gem

+3
source

Well, I fix my problem by updating the sass gem to the latest version (3.2.9). I think this update provides better compatibility with Ruby 2.0.0 when using the hewwatch parameter. Now everything is working fine.

+2
source

Source: https://habr.com/ru/post/946023/


All Articles