Listen error: unable to monitor directories for changes

后端 未结 5 849
走了就别回头了
走了就别回头了 2021-01-30 02:50

I am getting the following error while running my rails app in Ubuntu server

FATAL: Listen error: unable to monitor directories for changes. Visit https

相关标签:
5条回答
  • 2021-01-30 03:25

    This error occurred for me as I had a number of ruby processes currently running that I was unaware of. Just need to terminate them and all is good

    0 讨论(0)
  • 2021-01-30 03:35

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

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

    and

    If you are running Debian, RedHat, or another similar Linux distribution, 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
    
    0 讨论(0)
  • 2021-01-30 03:42

    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)
    
    0 讨论(0)
  • 2021-01-30 03:44

    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

    0 讨论(0)
  • 2021-01-30 03:44

    In my case, I just need to turn off the terminal and then start it back again. It works when I try to run rails c command :)

    0 讨论(0)
提交回复
热议问题