Wicked_pdf: ActionView :: Template :: Error (could not find file 'twitter / bootstrap'

We have some PDF generation code that works fine in the dev environment, but Rails shows an error when we try to display it when creating:

***************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' 

It does not try to include the application.css resource in:

 !!! %html %head %meta{"http-equiv"=>"content-type", :content=>"text/html; charset=utf-8"} = wicked_pdf_stylesheet_link_tag "application" %body .container = yield 
+4
source share
2 answers

The css file "twitter / bootstrap.css" will most likely not exist in production, since the stars will compile it into application.css - this will not be the case in development, however, if the stars support separate files by default.

Are you linking to twitter / bootstrap.css specifically in your code? If so, changing the link to application.css for production is likely to solve the problem.

+3
source

Do you have less bootstrap rails in the group :asset in your gemfile? If so, move him from there, and he can do the job!

+3
source

All Articles