SWF 文件生产中的 Rails 3.1 预编译错误
我有一些 .swf 文件正在通过 git 子模块添加到项目中。它们位于 /vendor/private/widget/
为了将 .swf 文件放入资产管道中,我正在执行以下操作:
config.assets.paths << "#{Rails.root}/vendor/private/widget"
在开发中,这工作得很好,但在生产中,我收到以下错误:
ActionView::Template::Error(widget.swf 未预编译):
在 StackOverflow 搜索之后,我尝试了这两种解决方案,但都不起作用:
config.assets.precompile << '*.swf'
config.assets.compile = true
I have a few .swf files that are being added to a project via a git submodule. They live in /vendor/private/widget/
To get the .swf files into the asset pipeline I'm doing the following:
config.assets.paths << "#{Rails.root}/vendor/private/widget"
In development this works just fine, but in production I get the following error:
ActionView::Template::Error (widget.swf isn't precompiled):
After searching around StackOverflow, I've tried these two solutions, both of which did not work:
config.assets.precompile << '*.swf'
config.assets.compile = true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 application.rb 设置
为
预编译,然后将其恢复为 true。我不知道为什么会这样,也不知道 url 摘要的哪一部分会阻止资产包含,但这是我发现能够在生产中生成资产以包含 swf 文件的唯一方法。
Try setting application.rb 's
to
for the precompile, and flip it back to true afterwards. I don't know why this works or what part of the url digest would be preventing the asset inclusion, but this has been the only way i've found to be able to generate my assets in production to include swf files.