wicked_pdf_stylesheet_link_tag fails with NoMethodError: undefined method 'find_asset' for nil:NilClass in production with sprockets-rails 3.0.0
See here: https://github.com/rails/sprockets-rails/issues/237
Something like this probably can be used instead of Rails.application.assets.find_asset:
manifest = Rails.application.assets_manifest
path = File.join(manifest.dir, manifest.assets['file.css'])
File.read(path)
I'm seeing the same thing with rails 4.2.5 and sprockets-rails 3.0.0.
And me. Same versions as leesmith.
I'm getting this same error on a Heroku instance. Any known versions where this doesn't happen?
@MaximilianoFelice Looks like any version of sprockets-rails less than 3.0 should work for now, but your issue may not be related. There's a number of reasons your asset might not be found.
@Bonias Would you be able to help test out that bit of code on a few different versions of Rails and send a PR?
@unixmonkey It seems to be the same issue described on the link provided by @Bonias, as turning assets.compile = true "fixes" it.
According to that link, by the way, sprockets team isn't very much willing to match the old behaviour any soon.
rails 4.2, seeing the same issue in prod.
+1
Rails 4.2.0
Sprockets-rails 3.0.0
Production environment
Did same thing as MaximilianoFelice
assets.compile = true and it got fixed.
Please read my solution here: http://stackoverflow.com/a/37820647/132235
Most helpful comment
@unixmonkey It seems to be the same issue described on the link provided by @Bonias, as turning
assets.compile = true"fixes" it.According to that link, by the way, sprockets team isn't very much willing to match the old behaviour any soon.