mileszs/wicked_pdf · error · WickedPdf::WickedPdfHelper::Assets::MissingLocalAsset

Could not find asset '#{pathname}'

Error message

Could not find asset '#{pathname}'

What it means

Error "Could not find asset '#{pathname}'" thrown in mileszs/wicked_pdf.

Source

Thrown at lib/wicked_pdf/wicked_pdf_helper/assets.rb:260

      end

      def read_asset(source)
        asset = find_asset(source)
        return asset.to_s.force_encoding('UTF-8') if asset

        unless precompiled_or_absolute_asset?(source)
          raise MissingLocalAsset, source if WickedPdf.config[:raise_on_missing_assets]

          return
        end

        pathname = asset_pathname(source)
        if pathname =~ URI_REGEXP
          read_from_uri(pathname)
        elsif File.file?(pathname)
          IO.read(pathname)
        elsif WickedPdf.config[:raise_on_missing_assets]
          raise MissingLocalAsset, pathname if WickedPdf.config[:raise_on_missing_assets]
        end
      end

      def read_from_uri(uri)
        response = Net::HTTP.get_response(URI(uri))

        unless response.is_a?(Net::HTTPSuccess)
          raise MissingRemoteAsset.new(uri, response) if WickedPdf.config[:raise_on_missing_assets]

          return
        end

        asset = response.body
        asset.force_encoding('UTF-8') if asset
        asset = gzip(asset) if WickedPdf.config[:expect_gzipped_remote_assets]
        asset
      end

View on GitHub (pinned to bce498de54)

When it happens

Trigger: Thrown at lib/wicked_pdf/wicked_pdf_helper/assets.rb:260 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mileszs/wicked_pdf@bce498de54 (2026-08-23). Data as JSON: /api/errors/bf8bfdec6dc5bfb7. Report an issue: GitHub.