使用Twitter Bootstrap进行Rails:仍在使用旧资产 [英] Rails with Twitter Bootstrap: still serving an old asset

查看:63
本文介绍了使用Twitter Bootstrap进行Rails:仍在使用旧资产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里发疯.我正在开发一个Rails应用程序,并且正在使用twitter-bootstrap-rails gem以便在我的应用程序中包含Twitter Bootstrap样式.这个gem在app/assets/stylesheets中生成一个名为"bootstrap_and_overrides.css.less"的文件,我一直在使用该文件来修改一些bootstrap变量并包括我自己的CSS覆盖.

Going nuts here. I'm developing a rails app, and I'm using the twitter-bootstrap-rails gem in order to include the Twitter Bootstrap styles in my app. This gem generates a file called 'bootstrap_and_overrides.css.less' in app/assets/stylesheets, which I have been using to modify some of the bootstrap variables and include my own CSS overrides.

直到今天,一切都运转良好.由于某些原因,我今天对该文件所做的更改已保存到该文件中,但是Rails仍在提供该文件的旧版本!我已经搜索过,在任何地方都没有找到文件的预编译版本(公共/资产中没有任何内容)...只有我一直在修改的资产/样式表中的版本.就应用程序中的目录而言,一切看起来都很好,但是当我启动Rails服务器,加载页面并使用元素检查器查看样式表时,它使用的是旧版本的"bootstrap_and_overrides.css.less"使用我已删除的规则.我已经在浏览器中打开了缓存,并且也在4种不同的浏览器中进行了尝试,因此,我很确定这不是浏览器缓存的结果.

Everything has been working fine until today. For some reason, the changes I am making to this file today are getting saved to the file, but Rails is still serving the old version of the file! I've searched and found no precompiled versions of the file anywhere (nothing in public/assets)...only the one in assets/stylesheets which I have been modifying. Everything looks fine as far as the directories within the app go, but then when I start the rails server, load the page, and use the element inspector to look at the stylesheets, it's using an old version of 'bootstrap_and_overrides.css.less' with rules that I have deleted. I've turned of the cache in my browser, and tried it in 4 different browsers too, so I'm pretty sure this isn't a result of browser caching.

Rails资产管道似乎只是在提供不存在的文件版本!有人知道为什么会发生这种情况吗?

The rails asset pipeline just seems to serving a version of the file that doesn't exist! Does anybody have any ideas why this might be happening?

推荐答案

已修复.

资产管道正在将缓存的版本存储在 tmp/cache 中.

The asset pipeline was storing a cached version in tmp/cache.

我运行了rake tmp:clear,该操作删除了其中的所有文件,然后然后导轨提供了我想要的* bootstrap_and_overrides.css.less *版本.

I ran rake tmp:clear, which deleted all the files in there, and then rails served the version of *bootstrap_and_overrides.css.less* that I wanted.

为什么缓存版本突然停止更新已超出我的范围.啊!

Why the cached version suddenly stopped getting updated is beyond me. Arrghhhh!

这篇关于使用Twitter Bootstrap进行Rails:仍在使用旧资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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