Error
Unable to monitor directories for changes because iNotify max watches exceeded
Context
I got the error after using the following command
rails generate migration addCommentsToProducts
OUtput
Solution
As the error message says, in order to solve the issue of inotify max watches being exceeded on Ubuntu, we can increase the number of inotify watchers.
Open a terminal
check the current value of inotify watchers with:
cat /proc/sys/fs/inotify/max_user_watches
Output
Increase the number of watches
sudo sysctl fs.inotify.max_user_watches=524288
OUtput
Make the change permanent
echo 'fs.inotify.max_user_watches=524288' | sudo tee -a /etc/sysctl.conf
Output
Apply changes
sudo sysctl -p
Output
Try again
Now, you should be able to use the Rails generator or your command without encountering the inotify error.
Output
Top comments (0)