mileszs/wicked_pdf · error · StandardError

Could not find binary xvfb-run on the system.

Error message

Could not find binary xvfb-run on the system.

What it means

Error "Could not find binary xvfb-run on the system." thrown in mileszs/wicked_pdf.

Source

Thrown at lib/wicked_pdf/binary.rb:33

      raise "#{EXE_NAME} is not executable" unless File.executable?(@path)
    end

    def version
      @version ||= retrieve_binary_version
    end

    def parse_version_string(version_info)
      match_data = /wkhtmltopdf\s*(\d*\.\d*\.\d*\w*)/.match(version_info)
      if match_data && (match_data.length == 2)
        Gem::Version.new(match_data[1])
      else
        default_version
      end
    end

    def xvfb_run_path
      path = possible_binary_locations.map { |l| File.expand_path("#{l}/xvfb-run") }.find { |location| File.exist?(location) }
      raise StandardError, 'Could not find binary xvfb-run on the system.' unless path

      path
    end

    private

    def retrieve_binary_version
      stdin, stdout, stderr = Open3.popen3(@path + ' -V')
      stdin.close
      stderr.close
      parse_version_string(stdout.gets(nil))
    rescue StandardError
      default_version
    end

    def find_binary_path
      exe_path ||= WickedPdf.config[:exe_path] unless WickedPdf.config.empty?
      exe_path ||= possible_which_path

View on GitHub (pinned to bce498de54)

When it happens

Trigger: Thrown at lib/wicked_pdf/binary.rb:33 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/63124748cd4c25d1. Report an issue: GitHub.