Poetry of Programming

Its about Ruby on Rails – Kiran Soumya

By

Issue with Guard

I came across this error this morning, “The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource. (Errno::ENOSPC)”

Tried Guard ignore path to .git or tried reducing the watch files under Guardfile, but alas! Guard by default handles that ignore path of .git and still it throws the same crazy error…

Googled the issues under Guard gem, then realized that you need to increase the watch count for the current user on your box to fix this.
# Check current maximum
$ cat /proc/sys/fs/inotify/max_user_watches
8192
# Increase the maximum
$ echo 100000|sudo tee /proc/sys/fs/inotify/max_user_watches
Password:
100000
$ cat /proc/sys/fs/inotify/max_user_watches
100000

This increases max_user_watches temporarily.On Ubuntu, to increase at boot, edit /etc/sysctl.conf and add fs.inotify.max_user_watches=100000.

Leave a Reply

Your email address will not be published. Required fields are marked *