I have quite a bit of experience developing Rails 4 apps on Mac OS X + Docker Machine + Docker Compose, but something has changed with how Rails 5 is caching files in the development environment (currently testing with RC1).
After starting the application with docker-compose up
, the application runs normally in development mode.
But if I make a change to a controller or model, the only way I can get that reflected in the application is to stop the server and start it back up.
So now my workflow looks something like this when I need to make a change to a controller or model:
Ctrl + C
.docker-compose up
.To say the least, needing to do steps 2-4 is annoying and not what I'm accustomed to from Rails 4.
I went a step further and uninstalled Spring using the Removal instructions, but I still get the same behavior.
I also searched for any settings that I could find in config/environments/development.rb
related to the Rails runtime's iron grip on the model and controller classes, and I couldn't find anything. (I assume that it really wants to rely on watching the filesystem in order to selectively load changes, and something isn't being picked up from a change on Mac to VirtualBox.)
Any other ideas on what I can try? Or are there any new settings related to how this more aggressive caching works?
I'm Using Rails 5 rc1.
Rails 5 introduced some "improvements" to code reloading, but it doesn’t seem to work with Docker on OS X.
So in config/environments/development.rb
, I replaced
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
with
config.file_watcher = ActiveSupport::FileUpdateChecker
It seems that for the ActiveSupport::EventedFileUpdateChecker file watcher, the change event does not occur for docker-machine shared files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With