In my code I have
<%= wicked_pdf_stylesheet_link_tag "admin/bootstrap_print" -%>
Everything works fine in development, but in production I get the error:
ActionView::Template::Error (No such file or directory - /assets/admin/bootstrap_print-6febc03c8e3adc61b770e6c7471ae248.css):
The file is compiled and is there, though... I'm really puzzled.
It must have something to do with the asses pipeline? I use wicked_pdf gem version 0.9.2
Thanks in advance for any help!
I would read the code for wicked_pdf_stylesheet_link_tag starting from here:
https://github.com/mileszs/wicked_pdf/blob/master/lib/wicked_pdf_helper.rb#L34
There are a few things it might do depending on how your assets are served in development and production.
@lafeber Did you find a solution for this issue?
Solved it by pasting CSS in the view... Including the absolute path to the
css file should also work.
On Sun, Mar 31, 2013 at 1:11 AM, Zane Shannon [email protected]:
@lafeber https://github.com/lafeber Did you find a solution for this
issue?—
Reply to this email directly or view it on GitHubhttps://github.com/mileszs/wicked_pdf/issues/188#issuecomment-15684245
.
If this works in your local environment, but not in your deployments (production) it could be that the stylesheets haven't been included to be precompiled. Add something like this:
config.assets.precompile += ['admin/bootstrap_print.css'] to your environments/production.rb file.
@brunzino that did the trick for me, excepting that now it should be added to initializers/assets.rb as with the rails update.
Most helpful comment
If this works in your local environment, but not in your deployments (production) it could be that the stylesheets haven't been included to be precompiled. Add something like this:
config.assets.precompile += ['admin/bootstrap_print.css']to yourenvironments/production.rbfile.