文件资产指纹在 Rails 3.1 上未正确更新

发布于 2024-12-26 13:00:08 字数 460 浏览 3 评论 0原文

在我的 Rails 3.1 应用程序中,在部署时,资产被编译并成功上传。

当我访问应用程序时,引用了 css 和 js 文件,但服务器返回 404。

<link href="/assets/application-f997bad128b3d8a92ed5619470851dab.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/application-d7eac22b3bc8b4e3620abb21f59a5faa.js" type="text/javascript"></script>

在服务器上查看,html 标记上打印的指纹不匹配,因此服务器返回 404。

但我想知道到底是怎么回事这种情况发生了。

那么,改变清单文件指纹的因素有哪些呢?

In my rails 3.1 app, while deploying, the assets is compiled and gets uploaded successfully.

When I visit the app, the css and js files are referenced but the server give back 404.

<link href="/assets/application-f997bad128b3d8a92ed5619470851dab.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/application-d7eac22b3bc8b4e3620abb21f59a5faa.js" type="text/javascript"></script>

Looking on the server, the fingerprint that is printed on the html markup doesn't match so the server returns 404.

But I wonder how the hell this happens.

So, what are the factors that change the fingerprinting of the manifest files?

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

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

发布评论

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

评论(1

作妖 2025-01-02 13:00:08

也许您的服务器没有重新加载。当 Unicorn 在向进程发送 USR2 信号后没有切换时,我遇到了这个问题。我必须手动终止并重新启动该进程才能使其再次运行。

Maybe your server wasn't reloaded. I've experienced this issue when Unicorn didn't switch over after sending the USR2 signal to the process. I had to manually kill and restart the process to get it going again.

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