当托管在VM和代码库上的Samba共享上时,Rails为什么缓存视图文件 [英] Why does Rails cache view files when hosted on VM and codebase on Samba share

查看:76
本文介绍了当托管在VM和代码库上的Samba共享上时,Rails为什么缓存视图文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有以下设置:


  • 我的本地计算机(OS X)上的代码作为Samba共享共享

  • 在Parallels中运行的Ubuntu VM,挂载共享

Railing Rails 2.1(通过Mongrel,WEBrick或passenger) )在开发模式下,如果我对视图进行更改,则无需我踢服务器就不会更新它们。我尝试改用NFS共享,但是遇到了同样的问题。我认为这是某种Samba缓存问题,但自动测试会立即获取对文件的更改。

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.

注意:


  • 这不是渲染缓存或模板缓存,并且在开发配置中未定义config.action_view.cache_template_loading。

  • 直接将代码库签出到VM不会显示相同的问题(但我不想这样做)

  • 直接在VM上编辑视图文件不能解决此问题。

  • 更改后触摸视图文件确实会导致更改显示在浏览器中。

  • 我还注意到VM中的时钟快了一个小时,将其更改为正确的时间没有影响。

  • 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.

推荐答案

在andLinux上进行开发时,我遇到了完全相同的问题。
My andLinux的时钟比主机Windows早了约三个小时,并且设置正确的时间(实际上比现在晚了一分钟左右)已解决了问题。

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.

这篇关于当托管在VM和代码库上的Samba共享上时,Rails为什么缓存视图文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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