Rails 3.2 资产管道与乘客无休无止的错误

发布于 2025-01-03 02:52:17 字数 706 浏览 3 评论 0原文

最近将我的应用程序迁移到 3.2.1,我似乎是另一位在资产管道中苦苦挣扎的开发人员。

一切看起来都不错,我的资产已编译并显然已投入使用。在我的文档的源代码中,我可以看到这一点:

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

并且该链接工作得很好。但是,我的 js 或 css 都没有实际加载。

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

 cache: [GET /] miss

我已调整我的 apache 配置以包括:

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

正在使用 capistrano 和乘客进行部署。

有人遇到过这个问题吗?

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" />

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

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

 cache: [GET /] miss

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>

Am deploying with capistrano and passenger.

Has anyone out there run into this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琴流音 2025-01-10 02:52:17

始终确保清除 /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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文