-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `find_asset' for nil:NilClass in production with sprockets-rails 3.0.0 #476
Comments
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 @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 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 Did same thing as MaximilianoFelice
|
Remove `asset_exists?` method. Replace it with `File.file?` at `read_asset`. Fix issue handled by `asset_exists?` at `wicked_pdf_stylesheet_link_tag` by changing `asset_pathname` method. `asset_exists?` coused problems with sprockets 3.0 so removing it fixes that. Always process assets at `wicked_pdf_stylesheet_link_tag` with `wicked_pdf_asset_path`. This fixes issue when `url(http://example.com/rails.png)` was removed. Rename `precompiled_asset?` to `precompiled_or_absolute_asset?` - this more precisely describe what this method does. Additionally return `true` if argument string starts with "http://" or "http://". Change `asset_pathname` to always return some value when assets compilation is enabled. This fixes problem when exception is raised when asset doesn't exists. Change `read_asset` to check if file exists before read it.
Fix #476 issue - problem with sprockets 3.0
Please read my solution here: http://stackoverflow.com/a/37820647/132235 |
…se of wikced_pdf bug. See mileszs/wicked_pdf#476
wicked_pdf_stylesheet_link_tag
fails withNoMethodError: undefined method 'find_asset' for nil:NilClass
in production withsprockets-rails 3.0.0
See here: rails/sprockets-rails#237
Something like this probably can be used instead of
Rails.application.assets.find_asset
:The text was updated successfully, but these errors were encountered: