【发布时间】:2021-04-20 12:50:25
【问题描述】:
我的 Rails 6 应用正在使用 webpack 和 yarn。我仍然为我的 sass 样式表使用资产管道。我正在为我使用 Wicked PDF 生成的 PDF 使用布局 css 样式表。我在生产中收到以下错误,但在开发中没有出现(因为根据最佳实践,配置设置回退到资产管道在生产中是错误的):
ActionView::Template::Error (The asset "%22images%2Fui-icons_555555_256x240.png%22" is not present in the asset pipeline.
--
<!-- application.pdf.erb, used as my layout for PDFs -->
<head>
<meta charset='utf-8' />
<%= wicked_pdf_stylesheet_link_tag "application" %> <!-- this one is problematic -->
<%= wicked_pdf_stylesheet_link_tag "application_pdf" %>
</head>
<!-- application.scss , line of the error -->>
...
@import "bootstrap/scss/bootstrap" // imported from node_modules, installed with yarn, using webpack
...
为什么我找不到 ui-icons 图片资源?我在这里做错了什么?
【问题讨论】:
标签: ruby-on-rails sass wicked-pdf