diff --git a/lib/sprockets/rails/helper.rb b/lib/sprockets/rails/helper.rb index 01f9f7e9..781327f3 100644 --- a/lib/sprockets/rails/helper.rb +++ b/lib/sprockets/rails/helper.rb @@ -81,10 +81,17 @@ def compute_asset_path(path, options = {}) File.join(assets_prefix || "/", legacy_debug_path(asset_path, debug)) else message = "The asset #{ path.inspect } is not present in the asset pipeline." - raise AssetNotFound, message unless unknown_asset_fallback + + unless unknown_asset_fallback + message << "\nThe following asset resolver strategies were used: " + message << (asset_resolver_strategies.join(', ').presence || + 'none (refer to: `config.assets.resolve_with` on https://github.com/rails/sprockets-rails)') + + raise AssetNotFound, message + end if respond_to?(:public_compute_asset_path) - message << "Falling back to an asset that may be in the public folder.\n" + message << "\nFalling back to an asset that may be in the public folder.\n" message << "This behavior is deprecated and will be removed.\n" message << "To bypass the asset pipeline and preserve this behavior,\n" message << "use the `skip_pipeline: true` option.\n"