Listen error: unable to monitor directories for changes Listen error: unable to monitor directories for changes ruby-on-rails ruby-on-rails

Listen error: unable to monitor directories for changes


1000 is way too small, try with 524288 as explained in the wiki page: https://github.com/guard/listen/blob/master/README.md#increasing-the-amount-of-inotify-watchers

Listen uses inotify by default on Linux to monitor directories forchanges. It's not uncommon to encounter a system limit on the numberof files you can monitor. For example, Ubuntu Lucid's (64bit) inotifylimit is set to 8192.

and

If you are running Debian, RedHat, or another similar Linuxdistribution, run the following in a terminal:

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

If you are running ArchLinux, run the following command instead

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system


Just try to execute this from your console

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

Hope this will work for you .

References: click here


For others who may have this issue. I had a VM disconnect which left the previous rails server running. Running below resolved the issue without needing to up the number of watcher.

 kill -9 $(lsof -i tcp:3000 -t)