diff --git a/bin/wkhtmltopdf-linux-amd64 b/bin/wkhtmltopdf-linux-amd64 new file mode 100755 index 0000000..f25d8e2 Binary files /dev/null and b/bin/wkhtmltopdf-linux-amd64 differ diff --git a/lib/wkhtmltopdf-osx.rb b/lib/wkhtmltopdf-osx.rb index 3a1e390..4612f6c 100644 --- a/lib/wkhtmltopdf-osx.rb +++ b/lib/wkhtmltopdf-osx.rb @@ -1,4 +1,8 @@ -WKHTMLTOPDF_PATH = File.expand_path "../../bin/wkhtmltopdf-darwin", __FILE__ +# use AMD64 library for heroku, Darwin library for OSX +on_heroku = !ENV.keys.select{|k| k.starts_with?("HEROKU")}.empty? +executable = on_heroku ? "wkhtmltopdf-linux-amd64" : "wkhtmltopdf-darwin" + +WKHTMLTOPDF_PATH = File.expand_path "../../bin/#{executable}", __FILE__ begin require 'pdfkit'