Why does Rails cache view files when hosted on VM and codebase on Samba share - ruby-on-rails

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.

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.

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.

Related

Electron does not run on shared folder

C:\share is shared folder.
C:\share\electron-v13.0.1-win32-x64, \\192.168.1.10\share\electron-v13.0.1-win32-x64 and Z:\electron-v13.0.1-win32-x64 are same folder.
Electron app is launched correctly when I execute C:\share\electron-v13.0.1-win32-x64\electron.exe command.
However, electron app is not launched correctly when I execute Z:\electron-v13.0.1-win32-x64\electron.exe command.
According to the task manager, electron processes are running.
However, electron's window is not shown.
Can electron run correctly on shared folder?
Should be safer to use it locally (from the C:\share). The mapped drives behave very differently compared to local filesystem. And their implementations can differ in their settings as well:
https://wiki.samba.org/index.php/Time_Synchronisation
https://www.truenas.com/community/threads/issue-with-modified-timestamps-on-windows-file-copy.82649/
https://help.2brightsparks.com/support/solutions/articles/43000335953-the-last-modification-date-and-time-are-wrong
If I understand you are just mapping back your own shared folder, and overall the Windows server cofigurations felt to me more consistent, however the protocol changed over the time as well:
https://en.wikipedia.org/wiki/Server_Message_Block
I do not understand the network sharing protocols well to give you exact answer why you have the problem, but I know enough to tell you that the mounted shared folders are not like your own local filesystem. In many cases the differences do not matter and it gives great user expierence, but in some cases these minute differences break things in misterious ways, even if they are mapped/mounted almost like a regular/local drive. This is not exclusive problem to Electron.
And that is a problem with a lot of things through SMB (mainly binaries/tools), the shared folder might be running a different filesystem, different permission and privileges (or run a completely different structure of permissions underneath if it's a completely different filesystem). Remote folders might have issues with inotify getting events on file updates, might miss changed file (like touch on Linux is meant to update date on the file), so through shared folder the date updates might be delayed/rounded. I think at one point even Makefiles were misbehaving as it was depending on the access-date to work the way it would locally.
Other problem with tools is the sharability, can it handle run multiple instances from the same location? Is it saving something into a ./tmp or some other file which could conflict with other user running it at the same time?
Overall with shares I tend to use them for data (and few times had issues with them as well), but have shared remotely applications only if they are known to not cause troubles.

Gitlab Pages delivers random content

I am experiencing weird behavior with the Pages feature of GitLab Omnibus package running on an Ubuntu 16.04 virtual machine. Some projects use Pages with Jekyll built by GitLab CI, which has been working as expected since it was first published with Gitlab CE.
For a couple of days now, visiting any of the homepages of those sites shows the content of just one of the projects. Each of them should of course show different content, but they all show the same. Even stranger: the content shown on each of the sites changes over time to one of the other projects, and I can not see whether this is deterministic.
Restarting the build processes of each of the projects did not fix this, neither did gitlab-ctl reconfigure, stop and start, nor rebooting the entire VM.
To investigate on that issue, I edited (which I assume is) the resulting file of the build process at /var/opt/gitlab/gitlab-rails/shared/pages/www/www.domain.org/public/index.html. Not in the first place, but later on during the already stated "rotating" content, the edits showed up on the webpage.
So what is going on there? Is this some caching issue? Is it malconfiguration? Is it a bug? Please help me find and fix the problem, as those are production websites.
Looks like this is actually an issue

More efficient way to view changes on a mobile device without pushing rails app to heroku?

Probably a dumb question:
Right now, to see changes made in development, I run rails s and see the changes on the local version of my site. To see how changes look on my phone, I currently commit to Git (no matter how small the changes) and then push to heroku. This takes some time and results in lots of commits and deployments for minor changes (i.e. CSS stuff).
What is a more efficient way to test changes for rails web apps on mobile?
NOTE: I am aware I can shrink my browser but it never fails I get different outcomes on my phone.
Any help is appreciated.
RELATED: how do i run a development rails app / website on an ipod
You can also use Nitrous.io which is a cloud development environment. I like it because not only can I view my work on mobile, but since it's a hosted URL, I can share it with others while my server is running.
1) connect your phone to the same network that your local server is running on and point it to http://[your server's ip]:3000
2) use the XCode iOS Simulator and/or the Android Emulator
you can also use ngrok
https://ngrok.com/
which gives you a way to make an external tunnel to the outside world (for free) so you can use it outside of your local network

What could cause my MVC apps to be incredibly slow to start?

Extremely often, in all kinds of various MVC3/4 apps I debug in VS2012 on my home machine, after pressing F5 to start debugging and open the configured start page in Chrome, it can take several - up to ten - minutes before becoming active.
I have no long startup procedures that load caches or generate code etc. and the same app will start instantly on my office machine. Quite often it will do so on my home machine as well, but this slow starting seems to come about after some hours of debugging, and possibly certain operations. Restarting VS doesn't seem to help, neither does killing IIS Express.
We were faced with an identical scenario recently where attaching the application to the debugger resulted in each page load taking about 10 minutes each, but running without debugging or in the QA environment worked fine.
The problem turned out to be that log4net was configured to use a network path for storing log files, a path that was unavailable from our local setup. This resulted in multiple attempts at accessing a remote path (once for each class being set up with Spring .Net) that didn't exist (and hence log4net threw an exception in each case).
But this should impact you out of the box, and shouldn't increase with time..

How do I access remote machine that runs on Pow (rails web server)

I've recently installed Pow on my Mac. It's great.
It's convenient for my own dev machine. But I wonder if I can set it up to be shared by my colleagues. The problem is DNS resolution part.
For example, if I have a dev site on my machine like "http://myapp.dev". How do I let my colleague access to the site on my machine from his machine?
The hacky way to do this is to make them edit their DNS and insert a record in /etc/hosts that maps to your machine. An easier way to do this is Localghost which doesn't require editing files by hand.
I've been using https://showoff.io and it works a treat. Also allows others not on local network to view it as well (if that's something you need).

Resources