Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7633163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:48:26+00:00 2026-05-31T06:48:26+00:00

Locally It works like magic but when I try to generate the PDF on

  • 0

Locally It works like magic but when I try to generate the PDF on the server it trows:

RuntimeError (Failed to execute:
"/path/to/my/project/vendor/bundle/ruby/1.9.1/bin/wkhtmltopdf"       -q - - 
Error: Broken pipe):

Here’s what’s on my_controller.

format.pdf do
    pdf = render_to_string(
            :pdf => "invoice",
            :template => "my_controller/my_view.pdf.erb",
            :layout=>"pdf.html.erb"
        )
    save_path = Rails.root.join('pdfs','invoice.pdf')
    File.open(save_path, 'wb') do |file|
        file << pdf
    end
    send_file(save_path)
end

And in my Gemfile

gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:48:27+00:00Added an answer on May 31, 2026 at 6:48 am

    Fixed removing system installed wkhtmltopdf and using the binary of wkhtmltopdf:

    1. Uninstall the wkhtmltopdf package: apt-get remove wkhtmltopdf --purge
    2. (in usr/local/bin) sudo curl -C - -O http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
    3. (in usr/local/bin) sudo tar -xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
    4. (in usr/local/bin) ln -s wkhtmltopdf-amd64 wkhtmltopdf
    5. In your initializer WickedPdf.config = {
      :exe_path => "/usr/local/bin/wkhtmltopdf"
      }
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Locally this works but on the server when i do something like /user/profile i
This works locally, but not on production server. Using ubuntu 10.04, rails 3.0.7, ruby
I have the following line of code which works fine locally, but breaks when
I set up subversion on my Windows 2008 server and it works fine locally,
Here's my node.js file I'm running on Heroku. It works perfectly locally, but when
I've an MEF application that works great when run locally, but doesn't work when
Everything works fine locally when I do as follows: cat input | python mapper.py
the current SQL query works fine locally on MAMP 1.8.4 running MySQL 5.1.37. SELECT
I've a Refinery app, works great locally. Created a bamboo stack on Heroku. When
I have successfully connected to a remote powershell session through WinRM. It works like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.