wicked_pdf_stylesheet_link_tag problem on production.

Created on 5 Feb 2013  Â·  5Comments  Â·  Source: mileszs/wicked_pdf

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!

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 your environments/production.rb file.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

netwire88 picture netwire88  Â·  7Comments

andheiberg picture andheiberg  Â·  3Comments

amerritt14 picture amerritt14  Â·  4Comments

thomasbalsloev picture thomasbalsloev  Â·  3Comments

lsarni picture lsarni  Â·  5Comments