带有乘客无尽错误的Rails 3.2资产管道 [英] Rails 3.2 Asset Pipeline with Passenger Endless Errors

查看:51
本文介绍了带有乘客无尽错误的Rails 3.2资产管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近将我的应用程序迁移到3.2.1,看来我是另一个在资产管道方面苦苦挣扎的开发人员.

Having recently migrated my app to 3.2.1, it would seem I'm another developer struggling with the asset pipeline.

一切看起来都很好,我的资产已经编译好了,显然已经送达了.在我的文档来源中,我可以看到以下内容:

Everything looks ok, my assets are compiled and apparently served. In the source of my doc I can see this:

 <link href="/assets/application-4fac522109a7afaaa2f18ef9f1294e19.css" media="screen" rel="stylesheet" type="text/css" />

链接正常工作.但是,我的js或CSS均未实际加载.

And the link works just fine. However, neither my js or css actually load.

我实际上可以在apache日志中看到的唯一错误是:

The only error I can actually see in the apache logs is this:

 cache: [GET /] miss

我已将我的Apache配置调整为包括:

I have adjusted my apache configuration to include:

 XSendFile On
 ...
 <LocationMatch "^/assets/.*$"> 
    Header unset Last-Modified
    Header unset ETag 
    FileETag None   
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
 </LocationMatch>

美军与capistrano和乘客一起部署.

Am deploying with capistrano and passenger.

有没有人遇到这个问题?

Has anyone out there run into this issue?

推荐答案

始终确保清除/your_app_path/tmp/cache.我通常也会消灭公众/资产.然后进行编译并重新启动应用程序.很多时候,这为我解决了管道中的奇怪问题.

Always make sure you wipe out /your_app_path/tmp/cache. I usually wipe out the public/assets also. Then do a compile and restart the app. Many times this solves odd issues with the pipeline for me.

这篇关于带有乘客无尽错误的Rails 3.2资产管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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