Open u007 opened 9 years ago
after debugging, i found that wicked_pdf_stylesheet_link_tag did not try to get the digested url for application.css. can someone tell me where went wrong? is it a bug on production?
ive this in my production.rb
config.serve_static_assets = true
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
If it's trying to get the undigested version, then you should precompile first.
https://github.com/mileszs/wicked_pdf#asset-pipeline-usage
config.assets.precompile += ['application.css.scss']
Indeed, in my case @unixmonkey is 100% correct that wicked_pdf tried to get the undigested version when my css wasn't compiled, but tried the correct digested version when my css was compiled. It's an easy trap to fall into because the failure mode is silent :/
hi, isnt application automatically added to precompile in rails 4?
That's a good point @u007 , yes, the example above isn't great. But if you follow the link cited, the README example shows explicitly precompiling pdf.css, which is representative of the solution to my problem.
@u007 hi, how did you solve it finally?
@Wangjiaji007 add the assets to to config/initializers/assets.rb, example:
Rails.application.config.assets.precompile += %w( pdf.css pdf.js )
Ive encountered a strange error using wicked_pdf, ive never has the same issue on my mac, but on my production centos 6.6 vps, it throws 404 error on the line:
im using
ive tried to add application.css.scss or application.css into initializer/assets.rb
but still does not work, anyone have any clue what can be done?
full trace showing: