LoginSignup
11
8

More than 3 years have passed since last update.

Rails testで「 FATAL: Listen error: unable to monitor directories for changes.」のエラー

Posted at

前提

Rails 6.0.3
ruby 2.6.3

本題

$rails test

のコマンドを実行した時に以下のエラーが発生。

$ rails test
FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info on how to fix this.

1つのユーザIDに対して生成できるinotifyのインスタンスの数の上限に達してしまったようなことが書かれている?のではないかと思いました。
エラー内容に書いている通り、Githubを確認しコマンドを入力し解決。

解決方法

ユーザーインスタンスを確認。

$ cat /proc/sys/fs/inotify/max_user_instances

inotifyのインスタンス上限を変更。

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

設定を反映。

$ sudo sysctl -p

再びコマンド実行。

$ rails test
11
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8