[英]wicked_pdf: ActionView::Template::Error (couldn't find file 'twitter/bootstrap'
我們有一些PDF生成代碼可以在開發環境中正常工作,但是Rails在嘗試在生產環境中渲染時顯示錯誤:
***************WICKED***************
Rendered invoices/show.pdf.haml within layouts/invoices_pdf.pdf (8.8ms)
Completed 500 Internal Server Error in 73ms
ActionView::Template::Error (couldn't find file 'twitter/bootstrap'
嘗試將application.css資產包括在以下內容中失敗:
!!!
%html
%head
%meta{"http-equiv"=>"content-type", :content=>"text/html; charset=utf-8"}
= wicked_pdf_stylesheet_link_tag "application"
%body
.container
= yield
css文件'twitter / bootstrap.css'在生產中可能不存在,因為鏈輪會將其編譯到application.css中-但是在開發中情況並非如此,但是鏈輪默認情況下會維護單獨的文件。
您是在代碼中專門引用twitter / bootstrap.css嗎? 如果是這樣,將對application.css的引用更改為生產可能會解決該問題。
您的gemfile中的:asset
組下是否具有less-rails-bootstrap? 如果是這樣,請將其從那里移出,它可能會完成工作!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.