#TL;DR
とりあえず一旦エラー解消できれば良いや!な人向けです。
rails server
するとタイトルのエラーが表示されました。
そこで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_watcher
とActiveSupport::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でコードの変更が反映されない