5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Rails】ERROR: directory is already being watched! つれぇわ【node_module】

Last updated at Posted at 2018-11-01

#TL;DR
とりあえず一旦エラー解消できれば良いや!な人向けです。
rails server するとタイトルのエラーが表示されました。
そこでapp/config/environments/development.rbを以下のように編集した所、治まりました。(※当該位置は一番下のはずです)

app/config/environments/development.rb
-- config.file_watcher = ActiveSupport::EventedFileUpdateChecker #こちらがデフォ。削除!
++ config.file_watcher = ActiveSupport::FileUpdateChecker #こちらに更新!

#環境

  • Vagrant 2.2.0
  • Rails 5.2.1
  • Ruby 2.5.1
  • Bundler 1.17.1
  • node v10.12.0
  • webpacker 4.0.0.pre.3
  • Yarn 1.10.1

#エラーメッセージ、エラー経緯
webpacker関係なんですかね…私の場合下記です。。

[vagrant@localhost app_name]$ rails s
=> Booting Puma
=> Rails 5.2.1 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development

Use Ctrl-C to stop
** ERROR: directory is already being watched! **

        Directory: /home/vagrant/hoge/app_name/node_modules/.bin/file-loader

        is already being watched through: /home/vagrant/hoge/app_name/node_modules/file-loader

        MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
        ** ERROR: directory is already being watched! **

        Directory: /home/vagrant/hoge/app_name/node_modules/.bin/mini-css-extract-plugin

        is already being watched through: /home/vagrant/hoge/app_name/node_modules/mini-css-extract-plugin

        MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
        ** ERROR: directory is already being watched! **

        Directory: /home/vagrant/hoge/app_name/node_modules/@rails/webpacker/node_modules/.bin/file-loader

        is already being watched through: /home/vagrant/hoge/app_name/node_modules/file-loader

        MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
        ** ERROR: directory is already being watched! **

        Directory: /home/vagrant/hoge/app_name/node_modules/@rails/webpacker/node_modules/.bin/mini-css-extract-plugin

        is already being watched through: /home/vagrant/hoge/app_name/node_modules/mini-css-extract-plugin

        MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors

#原因?
dockerでrails5環境構築
config.file_watcherActiveSupport::EventedFileUpdateCheckerについては、上記URLに詳しく書いてありました。
#参考
タイトルのメッセージでググると他にも色々出てきます。
上2つが自分に近いようです。
ERROR: directory is already being watched! -- GitHub rails/webpacker
lot of 'is already being watched through' messages when using rails console if using node_modules -- GitHub rails
Rails5 on Vagrant のdevelopmentでコードの変更が反映されない

5
5
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
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?