Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error when using command line for SASS to watch files

I've been having problems getting Sass working from terminal in Mac OS X Mavericks on my Macbook Pro. I'm working off a brand new clean install; reformatted my hard disk, loaded Mavericks, and first thing I went into the command line to set this up.

I did sudo gem install sass, then created two files on my desktop, test.css and test.scss. Then, when I try watching the files, I get an error:

$ sass --watch desktop/test.scss:desktop/test.css
>>> Sass is watching for changes. Press Ctrl-C to stop.
LoadError: cannot load such file -- rb-fsevent
  Use --trace for backtrace.
$

I have no idea what's going on or how to fix this, tried searching but didn't find any answers related to my problem. Sass -v gives me Sass 3.3.2 (Maptastic Maple).

like image 335
crimsonvessel Avatar asked Mar 14 '14 19:03

crimsonvessel


People also ask

How do I run a Sass command?

The command to run Sass is sass --watch input. scss output. css where 'input. scss' is your main Sass file (with all your partials imported) and 'output.

What is the correct command to install Sass in your project?

In the command line type the following: npm install sass -g . You type npm to tell the command line that you want to execute npm commands. install is the npm command that you are executing. It will download and install the indicated package(s).


1 Answers

Install the missing file: gem install rb-fsevent

The gem uses OS X's FSEvents API to listen for file system events including updated files (for example, your updated Sass file). As your OS has changed, it is reasonable to expect changes to how file system events are handled and therefore any gems that depend on file system behaviour.

like image 193
jeremysmith Avatar answered Oct 08 '22 22:10

jeremysmith