If you try to install Asciidoctor-pdf as explained here and fail because of your ruby version (you have ruby 2.0.0 on your mac running on El Capitan BUT it requires ruby in 2.1), this could be the way to proceed.
Note: It might be the long way. If you know a shorter one, feel free to contact me and let me know. Thanks!
Update ruby
- Update ruby as explained here, but make sure it is 2.3.0.
- Install first RVM…
curl -sSL https://get.rvm.io | bash -s stable --ruby
- Quit and restart the Terminal.app, call
rvm list known
- If this worked, you can install ruby 2.3.0 thus
rvm install ruby-2.3.0
- When asked to install Xcode and update your OS, just confirm and enter your root password whenever needed.
- Check the installed ruby version by…
ruby -v
If it returns ruby 2.3.0p0 … Congrats, you finally made it!
Install asciidoctor-pdf
- Now you can install asciidoctor-pdf thus
sudo gem install asciidoctor-pdf
- When this is done, you can try converting* a txt file by
asciidoctor-pdf your text file
Live long and prosper!
Sources:
github.com
stackoverflow.com
Related post:
Update asciidoctor and asciidoctor-pdf
*) I still have thus some warnings like the following, but as long as the PDF conversion works, that’s fine with me.
/Users/myuser/.rvm/gems/ruby-2.3.0@global/gems/pdf-core-0.7.0/lib/core/text.rb.12: warning: already initialized constant PDF::Code::Text::VALID_OPTIONS