Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sass issue when i use the --watch parameter

Tags:

sass

When i execute the line

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

i get the following message

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

As you can say the process stops immediately and the watch option doesn't work.

What's the problem here ?? I have installed the Ruby 2.0.0-p0 version.

Any help appreciated.

EDIT: (--trace)

Sass is watching for 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:266: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
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/bin/sass:9:in <top (required)>'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in
load'
from /home/javier/.rvm/gems/ruby-2.0.0-p0/bin/sass:23:in `'

like image 586
Javier Cadiz Avatar asked May 28 '13 15:05

Javier Cadiz


4 Answers

I tried these answers and none worked, so i did some more research. Apparently, the problem is with the listen gem that SASS is using. Sass is only compatible with listen 0.7.

I was able to get it working by running the following two commands (as root):

gem uninstall listen
gem install listen -v 0.7.3
like image 51
Scimonster Avatar answered Oct 19 '22 08:10

Scimonster


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

sudo sass --watch sass/views.scss:views.css
like image 30
user681365 Avatar answered Oct 19 '22 06:10

user681365


I fixed it by uninstalling the original sass I had installed using apt-get (ruby-sass) and reinstalled using gem

like image 3
Jason Pascoe Avatar answered Oct 19 '22 07:10

Jason Pascoe


Well i fix my problem updating the sass gem to the latest version (3.2.9). I think that this update provide better compatibility with Ruby 2.0.0 when using he --watch parameter. Everything works great now.

like image 2
Javier Cadiz Avatar answered Oct 19 '22 07:10

Javier Cadiz