Rails 4.1 不会在 Vagrant VM 上自动重新加载 [英] Rails 4.1 doesn't autoreload on Vagrant VM

查看:22
本文介绍了Rails 4.1 不会在 Vagrant VM 上自动重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我将应用程序从 Rails 3.2 升级到 Rails 4.1 后,我注意到自动重新加载在我的 VM 上不起作用,但它曾经起作用,我将eager_load 设置为 false 并将 cache_classes 设置为 false 并删除了对线程安全的任何调用!选项

After I upgraded my app from Rails 3.2 to Rails 4.1 I noticed that auto reloading wasn't working on my VM but it used to be working, I set eager_load to false and cache_classes to false and removed any calls to the threadsafe! option

这些线程中没有任何内容提供解决方案为什么 Rails 不会在每次请求时刷新类(尽管配置)?https://github.com/rails/rails/issues/14382

Nothing in these threads provided a solution Why does Rails not refresh classes on every request (despite configuration)? https://github.com/rails/rails/issues/14382

所以我认为我的应用程序做了一些奇怪的事情,但是当我创建一个简单的演示应用程序时,我注意到了同样的事情 https://github.com/benedictfischer09/reload_problem.在我的本机机器上运行的服务器自动重新加载正常,但在 VM 上它不起作用.

So I figured my app was doing something weird, but when I created a simple demo app I noticed the same thing https://github.com/benedictfischer09/reload_problem. The server running on my native machine auto reloads fine but on the VM it doesn't work.

我正在使用 NFS 将目录共享到 VM,谁能解释一下可能发生的情况以及如何修复它?

I'm using NFS to share the directory to the VM, can anyone explain what might be happening and how I could fix it?

推荐答案

显然存在 VM 时钟未与主机时钟同步的问题,这里是 github 讨论 https://github.com/rails/rails/issues/16678

Apparently there is an issue with the VM clock not being synced with the host clock, here's the github discussion https://github.com/rails/rails/issues/16678

这篇关于Rails 4.1 不会在 Vagrant VM 上自动重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆