Failed To Execute Wkhtmltopdf Error Pdf Could Not Be Generated
Contents |
Sign in Pricing Blog error: pdf could not be generated! wicked_pdf Support Search GitHub This repository Watch (sometimes it will work just to ignore this error with --ignore-load-errors) 45 Star 2,126 Fork 396 mileszs/wicked_pdf Code Issues 109 Pull requests 7 error: failed to execute: wkhtmltopdf Projects 0 Wiki Pulse Graphs New issue RunTime Error: PDF could not be generated! Command Error: /usr/bin/env: ruby: No bad wkhtmltopdf's path such file or directory #266 Closed lauramosher opened this Issue Oct 31, 2013 · 9 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 4 participants lauramosher commented Oct 31, 2013
Wicked_pdf Gem
RunTime Error: PDF could not be generated! Command Error: /usr/bin/env: ruby: No such file or directory wicked pdf This code works fine locally but in production environments it is failing on export. Log below. INFO: ***************WICKED*************** Rendered index.pdf.haml within layouts/pdf (209.2ms) Rendered _header.pdf.haml within layouts/pdf (1.5ms) Completed 500 Internal Server Error in 3406ms FATAL: RuntimeError(Failed to execute:\n"/opt/application/releases/5405db831e02eb2987cc06b243333776ce9c34b8ab6db3e58e93f39c3f933621/vendor/bundle/ruby/2.0.0/bin/wkhtmltopdf" -q --header-html "file:////tmp/wicked_header_pdf20131031-15836-12qkok6.html" --footer-right "[page] of [topage]" --footer-font-size 9 --margin-top 50 --encoding "UTF-8" "file:////tmp/wicked_pdf20131031-15836-b874ab.html" "/tmp/wicked_pdf_generated_file20131031-15836-1ibji4k.pdf" \nError: PDF could not be generated!\n Command Error: /usr/bin/env: ruby: No such file or directory\n) vendor/bundle/ruby/2.0.0/gems/wicked_pdf-0.9.7/lib/wicked_pdf.rb:69:in `rescue in pdf_from_string' vendor/bundle/ruby/2.0.0/gems/wicked_pdf-0.9.7/lib/wicked_pdf.rb:73:in `pdf_from_string' vendor/bundle/ruby/2.0.0/gems/wicked_pdf-0.9.7/lib/pdf_helper.rb:63:in `make_pdf' vendor/bundle/ruby/2.0.0/gems/wicked_pdf-0.9.7/lib/pdf_helper.rb:76:in `make_and_send_pdf' vendor/bundle/ruby/2.0.0/gems/wicked_pdf-0.9.7/lib/pdf_helper.rb:21:in `render_with_wicked_pdf' Relevant Code: Gemfile gem 'wicked_pdf', '~> 0.9.7' gem 'wkhtmltopdf-binary', '~> 0.9.9' Controller render pdf: "#{person_name}_#{localize_date(Time.no
Sign in Pricing Blog Support Search GitHub This repository Watch 45 Star 2,126 Fork 396 mileszs/wicked_pdf Code Issues 109 Pull
Wkhtmltopdf Binary Edge
requests 7 Projects 0 Wiki Pulse Graphs New issue RuntimeError (Error: install wkhtmltopdf ubuntu Failed to execute: "/usr/bin/wkhtmltopdf" #361 Open kannathasan-san opened this Issue Nov 20, 2014 · 24 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 19 participants kannathasan-san commented Nov 20, 2014 I am using wkhtmltopdf(0.10.0 rc2) https://github.com/mileszs/wicked_pdf/issues/266 and wicked_pdf(0.9.9) for generating pdf report. While running i got the following error. RuntimeError (Error: Failed to execute: ["/usr/bin/wkhtmltopdf", "-q", "--page-size", "A4", "--margin-top", "5", "--margin-bottom", "10", "--margin-left", "5", "--margin-right", "5", "file:////tmp/[\"wicked_pdf\", \".html\"]21873-0", "/tmp/[\"wicked_pdf_generated_file\", \".pdf\"]21873-0"] Error: PDF could not be generated! Command Error: Error: Failed loading page file:////tmp/["wicked_pdf", ".html"]21873-0 (sometimes it will work just to ignore this https://github.com/mileszs/wicked_pdf/issues/361 error with --load-error-handling ignore) ) my controller are: render :pdf => "#{@note_name}",:layout => '/layouts/pdf_template.html.erb', :template=>'pdf/financial/maintenance_exp/maintenance_exp_pdf.html.erb' Any help would be appreciated. FYI:when I do :show_as_html=>true its not throwing any error.its rendering the html in browser. Collaborator unixmonkey commented Nov 20, 2014 Could you try pointing your Gemfile at the master branch and let me know if that helps? The currently released gem versions are designed to work with wkhtmltopdf 0.9.9 and earlier, and we are working the kinks out for later versions at the moment. gem 'wicked_pdf', github: 'mileszs/wicked_pdf' kannathasan-railsfactory commented Nov 21, 2014 Yes I tried the same.its throwing the same error.. Collaborator unixmonkey commented Nov 21, 2014 The tempfiles aren't getting transformed into path strings correctly: file:////tmp/["wicked_pdf", ".html"] What version of Ruby are you using? kannathasan-railsfactory commented Nov 24, 2014 Ruby 1.9.3 Collaborator unixmonkey commented Nov 24, 2014 I'm having trouble reproducing the issue. Do you have any global settings (like :temp_path) set? Can you paste the error you get against master, too? joseg
here for a quick overview of the site Help Center Detailed answers to any questions you might http://stackoverflow.com/questions/14851932/error-pdf-could-not-be-generated-with-wickedpdf have Meta Discuss the workings and policies of this site About http://stackoverflow.com/questions/26514488/wicked-pdf-error-pdf-could-not-be-generated Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, failed to just like you, helping each other. Join them; it only takes a minute: Sign up “Error: PDF could not be generated!” with WickedPDF up vote 3 down vote favorite Error: RuntimeError in BillsController#printing Failed to execute: "/usr/local/bin/wkhtmltopdf" -q "file:////var/folders/j5/2wx0qdjj7kl7vbvq3m2z4rj00000gn/T/wicked_pdf20130213-41259-x9dcb5.html" "/var/folders/j5/2wx0qdjj7kl7vbvq3m2z4rj00000gn/T/wicked_pdf_generated_file20130213-41259-mg4iqp.pdf" Error: PDF could not be generated! BillsController: # GET /bills # GET /bills.json def print failed to execute respond_to do |format| format.html format.pdf do render :pdf => "rechnung_id", :layout => "printing.pdf", :show_as_html => params[:debug] end end end as views I created a printing.html.erb and a printing.pdf.erb - and tried both. I've installed wkhtmltopdf as binary and as gem. When I try to use the gem (commenting out the line: WickedPdf.config = { :exe_path => '/usr/local/bin/wkhtmltopdf'} something seems to crash and nothing happens.. When I use the binary, I get the error displayed on top. The versions of my gems are: wicked_pdf (0.9.4) and wkhtmltopdf-binary (0.9.9.1). I was searching for help - that's what I already tried: "bundle update" and "bundle install" installed wkhtmltopdf in version 9.9 added "Mime::Type.register "application/pdf", :pdf" EDIT: If I use the terminal and enter "wkhtmltopdf www.myHomepage.info myhomepage.pdf" it works fine. "which wkhtmltopdf" gives me the path "/usr/bin/wkhtmltopdf", but if I want to use with one, it's opening "wkhtmltopdf_darwin_386" and the website freezes.. ruby-on-rails wicked-pdf share|improve this question edited Feb 13 '13 at 11:02 asked Feb 13 '13 at 10
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up wicked-pdf: Error: PDF could not be generated up vote 0 down vote favorite I am trying to create pdf order receipts on our app (on Heroku). I am running the PDF generator as a delayed job. I have: -created a bin folder in the root of the app -added the binaries (x86-64) to that folder -added wicked pdf gem to my gemfile I am testing it on our staging app. This is the error I'm getting: Error: Failed to execute: ["/app/vendor/bundle/bin/wkhtmltopdf", "-q", "--page-size", "Letter", "file:///tmp/wicked_pdf20141022-213-3dpi58.html", "/tmp/wicked_pdf_generated_file20141022-213-1tqzjod.pdf"] Error: PDF could not be generated! Command Error: /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.6.3/lib/bundler/rubygems_integration.rb:305:in 'block in replace_bin_path': undefined method name' for nil:NilClass (NoMethodError) from /app/vendor/bundle/bin/wkhtmltopdf:16:in Any ideas on what may be going on here? I'm at bit of a loss. CODE: #config/initializers/wicked-pdf.rb WickedPdf.config do |config| if Rails.env == 'production' then config.exe_path = Rails.root.to_s + "/bin/wkhtmltopdf-amd64" else if /darwin/ =~ RUBY_PLATFORM then config.exe_path = '/usr/local/bin/wkhtmltopdf' else raise "UnableToLocateWkhtmltopdf" end end end I'm calling to queue the job in my order controller #jobs/pdf_receipt_job class PdfReceiptJob < Struct.new(:order_id) def perform order = Order.find(order_id) # create an instance of ActionView, so we can use the render method outside of a controller view = ActionView::Base.new(ActionController::Base.view_path