Code is not reloaded in dev with Docker on OS X #25186
Steps to reproduce
The page should display "coconut".
The page displays the old "hello world!" text.
Rails version: 5.0.0.rc1
Ruby version: 2.3.1
To make code reloading work for now, in
Restart everything, and code reloading should work.
I have a feeling that for the
Even if it is docker-machine's fault, since I cannot pinpoint the exact problem, I would not know how to articulate it if I were to open an issue on their github repo. We might also find a workaround in Rails or add a warning the Rails documentation. That's why I am opening this issue here. Any insight would be appreciated.
The text was updated successfully, but these errors were encountered:
This is something Rails cannot do anything about unless support for detecting this at runtime and hot-switching the monitors is implemented.
Also, you could generate the conservative option always (it was this way when the feature was first implemented). But it was decided to generate the config for the evented monitor by default (mod those simple exceptions linked above) because it is believed that most setups can benefit from it. If the setup does not support it, then you need to opt-out.
I think we can close this one on the basis of not having a bug here, but if you believe Rails could explain this better somewhere please feel free to make a proposal.
After change, code is reloaded with ~5 min lag, which makes code reload feature practically useless. Is there any workaround for this?
@f1nnix Frankly there never will. You're writing to a file on a computer, that then has to tell some extra file system (Likely vbfs or nfs) of the event, that then has to propagate to the guest machine's filesystem, that then has to report to docker that the file event happened.
Basically, avoid dealing with superhost machine file events.
Just to add to this issue. If you are running your Rails app within a VirtualBox VM, then you are highly likely to experience this too. It doesn't always happen though so it's very tricky to diagnose properly.
Updates made to views won't reflect until you full restart the Rails server.
To fix the issue:
In environments/development.rb, comment out:
Current version of what I'm running (for context):
It's probably just my system, but I recently upgraded to Docker Desktop Community 188.8.131.52 for Mac and lost file updates in Docker.
It works fine if I'm running on my host machine (OSX) or if I switch the