Shijin T R Shijin T R - 9 months ago 108
Sass (Sass) Question

FATAL: Listen error: unable to monitor directories for changes

I am trying to watch a sass directory .I created sass project using the following command on my ubuntu 16.4 system

compass create sass

And got the result

directory sass/ directory sass/sass/ directory sass/stylesheets/ create sass/config.rb create sass/sass/screen.scss create sass/sass/print.scss create sass/sass/ie.scss
write sass/stylesheets/ie.css
write sass/stylesheets/print.css
write sass/stylesheets/screen.css

********************************************************************* Congratulations! Your compass project has been created.

You may now add and edit sass stylesheets in the sass subdirectory of your project.

Sass files beginning with an underscore are called partials and won't be compiled to CSS, but they can be imported into other sass stylesheets.

You can configure your project by editing the config.rb configuration file.

You must compile your sass stylesheets into CSS when they change. This can be done in one of the following ways:
1. To compile on demand:
compass compile [path/to/project]
2. To monitor your project for changes and automatically recompile:
compass watch [path/to/project]

More Resources: * Website: * Sass: * Community:

To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage: <head> <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> <!--[if IE]>
<link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" /> <![endif]--> </head>

And i try to watch this using
compass watch
results an error as shown bellow

Compass is watching for changes. Press Ctrl-C to Stop. FATAL: Listen error: unable to monitor directories for changes. Visit
for info on how to fix this.
2016/library/sass$ compass watch

enter image description here

Answer Source

Just try to execute this from your console:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

This works for me.

References: click_here