Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Error: The wkhtmltopdf executable in the wkhtmltopdf-binary-edge gem is being loaded, but it's also present in other gems (wkhtmltopdf-binary) #907

Open
RubenGram opened this issue Apr 24, 2020 · 4 comments

Comments

@RubenGram
Copy link

Issue description

The next problem ocurred when I was trying to create a pdf:
"The wkhtmltopdf executable in the wkhtmltopdf-binary-edge gem is being loaded, but it's also present in other gems (wkhtmltopdf-binary) If you meant to run the executable for another gem, make sure you use a project specific binstub (bundle binstub <gem_name>)"

Are both wkhtmltopdf-binary-edge and wkhtmltopdf-binary gems necessary?

Error: Failed to execute: ["/.rbenv/versions/2.3.6/bin/wkhtmltopdf", "-q", "--encoding", "UTF-8", "file:///var/folders/ds/70lrh2194yb9jnwgzx28vm100000gn/T/wicked_pdf20200423-33047-47tsw2.html", "/var/folders/ds/70lrh2194yb9jnwgzx28vm100000gn/T/wicked_pdf_generated_file20200423-33047-1hbwcmu.pdf"] Error: PDF could not be generated! Command Error: The wkhtmltopdfexecutable in thewkhtmltopdf-binary-edge gem is being loaded, but it's also present in other gems (wkhtmltopdf-binary). If you meant to run the executable for another gem, make sure you use a project specific binstub (bundle binstub <gem_name>). If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names. /.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/bin/wkhtmltopdf:17:in exec': Bad CPU type in executable - /.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/libexec/wkhtmltopdf-darwin-x86 (Errno::E086) from /.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/bin/wkhtmltopd`

System specifications

wicked_pdf gem version: 0.11.0

wkhtmltopdf version (output of wkhtmltopdf --version): 0.12.5 (with patched qt)

wkhtmltopdf-binary version: 0.12.4

wkhtmltopdf-binary-edge version: 0.12.2.1

platform/distribution and version: MacOS Catalina

Rails version: 4.2.1

@darrenterhune
Copy link

You don't need both wkhtmltopdf-binary and wkhtmltopdf-binary-edge you should be using only one of those.

@RubenGram
Copy link
Author

You don't need both wkhtmltopdf-binary and wkhtmltopdf-binary-edge you should be using only one of those.

Thanks for replying, do you have a suggestion about which should I use? And gem uninstall 'gemname' would be enough?

@darrenterhune
Copy link

This really depends on your platform. Locally I've installed it with homebrew on Mac OS X. In this case you could just use the wkhtmltopdf-binary. For us we also have CircleCI which requires a specific version so we do this in our Gemfile

gem "wkhtmltopdf-binary-edge", "~> 0.12.4.0" if ENV["CIRCLECI"]

Then because we deploy on Heroku we again have this in our :production group:

group :production, :staging do
  gem "wkhtmltopdf-heroku"
end

If your simply developing this locally and then deploying it on your own Ubuntu distro you would probably be fine with just wkhtmltopdf-binary

@Wmeng98
Copy link

Wmeng98 commented Jun 30, 2020

Additionally, If you look at the README for the wkhtmltopdf-binary-edge gem, it's recommended for use in development & testing only. This is because it includes binaries for various operating systems and therefore large in size.

Alternatively, you could install wkhtmltopdf directly (https://github.com/wkhtmltopdf/wkhtmltopdf/releases) and point the exe_path in initializers/wicked_pdf.rb to the location of the executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants