We recently upgraded a Rails project from Rails 5 to 6. It was pretty smooth in general, but I noticed in development (with Docker) that views weren't updating with changes - as if they were being cached.
The culprit turned out to be this segment of config/development.rb
:
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
ActiveSupport::EventedFileUpdateChecker
dislikes either Docker volumes or Windows - I'm leaning towards the latter and it being a dependency issue relating to FS notifications.
If you're hitting this issue: just comment out the config.file_watcher
line and you'll be back on track.
Top comments (6)
Thank you for this, but I would not suggest fully commenting it out but instead using
config.file_watcher = ActiveSupport::FileUpdateChecker
instead.See the difference here:
github.com/rails/rails/blob/cd54d9...
github.com/rails/rails/blob/93b16e...
This was the case for me too. I was using Windows with WSL2 and this solved it.
This solved my problem. Thank you. :)
My savior of the day! 🙏
wow...works like charm! thank you.
I was using Docker on MacOS and was trying to fix it hours. I wish I had looked at this solution a lot before 🙏 Thanks a lot 💪