Help us understand the problem. What is going on with this article?

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

前提

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
yusuke_mrmt
自分用メモです。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした