asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 501 forks source link

Could not find 'prawn' #1851

Closed TheDcoder closed 3 years ago

TheDcoder commented 3 years ago

Hi, I just installed the asciidoctor-pdf gem and I am getting this error when I run it:

TheDcoder@arch /tmp> echo "Hello World" | asciidoctor-pdf -o - -
Traceback (most recent call last):
    8: from /home/TheDcoder/.gem/ruby/2.7.0/bin/asciidoctor-pdf:23:in `<main>'
    7: from /usr/lib/ruby/2.7.0/rubygems.rb:297:in `activate_bin_path'
    6: from /usr/lib/ruby/2.7.0/rubygems.rb:297:in `synchronize'
    5: from /usr/lib/ruby/2.7.0/rubygems.rb:298:in `block in activate_bin_path'
    4: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:1371:in `activate'
    3: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:1389:in `activate_dependencies'
    2: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:1389:in `each'
    1: from /usr/lib/ruby/2.7.0/rubygems/specification.rb:1400:in `block in activate_dependencies'
/usr/lib/ruby/2.7.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'prawn' (~> 2.2.0) among 176 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/home/TheDcoder/.gem/ruby/2.7.0:/usr/lib/ruby/gems/2.7.0', execute `gem env` for more information

My ruby installation and gems are fully updated too, not sure why "prawn" is missing.

mojavelinux commented 3 years ago

I think you will find that if you look in /home/TheDcoder/.gem/ruby/2.7.0:/usr/lib/ruby/gems/2.7.0, you will not find the prawn gem installed. It seems you either have an incomplete installation or the environment has confused Ruby. This is not an issue with this gem.

To make things simpler, I recommend using bundler to manage your gems. It manages GEM_PATH for you, which can be tricky to get right on your own.

TheDcoder commented 3 years ago

@mojavelinux Thank you for the pointers, it was an incomplete installation and I am not sure how that happened.

prawn and other dependencies were not correctly installed in my computer for some reason.

The issue has now been fixed for me after doing a gem install asciidoctor-pdf --verbose --debug as part of an attempt to find the cause of the issue. What's strange is that I attempted to re-install before this but that did not result in a fix.

I am still not sure about the cause, but I am happy that the issue has been resolved.

mojavelinux commented 3 years ago

I've very glad to hear that! If you discover anything later on that led to this issue, feel free to circle back and post your finding here.