diff --git a/lib/wicked_pdf.rb b/lib/wicked_pdf.rb index 9b4ec24d..e1fb4f14 100644 --- a/lib/wicked_pdf.rb +++ b/lib/wicked_pdf.rb @@ -39,8 +39,9 @@ class WickedPdf def initialize(wkhtmltopdf_binary_path = nil) @exe_path = wkhtmltopdf_binary_path || find_wkhtmltopdf_binary_path raise "Location of #{EXE_NAME} unknown" if @exe_path.empty? - raise "#{EXE_NAME} is not executable" unless File.executable?(@exe_path) - + raise "The executable provided doesn't seem to be #{EXE_NAME}" unless `#{@exe_path} --version`.start_with?(EXE_NAME) + raise "#{EXE_NAME} isn't running correctly" unless $?.success? + retrieve_binary_version end