Why does Rails cache view files when hosted on VM and codebase on Samba share
-
01-07-2019 - |
Question
I have the following setup:
- Code on my local machine (OS X) shared as a Samba share
- A Ubuntu VM running within Parallels, mounts the share
Running Rails 2.1 (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to my views they don't update without me having to kick the server. I've tried switching to an NFS share instead but I get the same problem. I would assume it was some sort of Samba cache issue but autotest picks up the changes to files instantly.
Note:
- This is not render caching or template caching and config.action_view.cache_template_loading is not defined in the development config.
- Checking out the codebase direct to the VM doesn't display the same issue (but I'd prefer not to do this)
- Editing the view file direct on the VM does not resolve this issue.
- Touching the view file after alterations does cause the changes to appear in the browser.
- I also noticed that the clock in the VM was an hour fast, changing that to the correct time made no difference.
Solution
I had the exact same problem while developing on andLinux. My andLinux's clock was about three hours ahead of the host Windows, and setting the correct time (actually, a minute or so behind) has solved the problem.
OTHER TIPS
Actually, setting the correct date & time in the VM does seem to have solved the problem (after I restarted mongrel) -- going to do a little more digging.