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

asciidoctor-diagram #70

Open
marmalodak opened this issue May 5, 2021 · 2 comments
Open

asciidoctor-diagram #70

marmalodak opened this issue May 5, 2021 · 2 comments

Comments

@marmalodak
Copy link

The following worked well:

brew install brew-gem
brew gem install asciidoctor-diagram

However, using asciidoctor-diagram doesn't seem to work:

asciidoctor --trace -b html5 -r asciidoctor-diagram index.adoc
Traceback (most recent call last):
        10: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/bin/asciidoctor:23:in `<main>'
         9: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/bin/asciidoctor:23:in `load'
         8: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/bin/asciidoctor:13:in `<top (required)>'
         7: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/bin/asciidoctor:13:in `new'
         6: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/lib/asciidoctor/cli/invoker.rb:24:in `initialize'
         5: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/lib/asciidoctor/cli/options.rb:34:in `parse!'
         4: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/lib/asciidoctor/cli/options.rb:275:in `parse!'
         3: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/lib/asciidoctor/cli/options.rb:275:in `each'
         2: from /opt/brew/Cellar/asciidoctor/2.0.13/libexec/gems/asciidoctor-2.0.13/lib/asciidoctor/cli/options.rb:277:in `block in parse!'
         1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- asciidoctor-diagram (LoadError)

What can I do to make this work?

@NickLaMuro
Copy link

@marmalodak This is a bit of a invalid use case for brew gem since you are really doing:

brew install brew-gem
brew gem install asciidoctor
brew gem install asciidoctor-diagram

In which you are installing asciidoctor with a plugin, asciidoctor-diagram. As mentioned in the README.md:

brew gem allows you to install any rubygem as a homebrew formula.

It works by generating a stub formula for homebrew...

This formula installs and unpacks all the dependencies under the Cellar path. So the package is completely self contained.

The "self contained" part being the key words here. You can see what I mean by taking a look at the generated bin file for your asciidoctor installation:

$ which asciidoctor
/usr/local/bin/asciidoctor
#!/usr/local/opt/ruby/bin/ruby --disable-gems
ENV['GEM_HOME']="/usr/local/Cellar/gem-asciidoctor/2.0.15"
ENV['GEM_PATH']="/usr/local/Cellar/gem-asciidoctor/2.0.15"
require 'rubygems'
$:.unshift("/usr/local/Cellar/gem-asciidoctor/2.0.15/gems/asciidoctor-2.0.15/lib")
load "/usr/local/Cellar/gem-asciidoctor/2.0.15/gems/asciidoctor-2.0.15/bin/asciidoctor"

The /usr/local/Cellar/gem-asciidoctor/2.0.15 is the self contained gem path. This means that the brew gem install asciidoctor-diagram was placed into it's own /usr/local/Cellar/gem-asciidoctor-diagram dir, and the asciidoctor bin has no knowledge of it's existence.


An unsupported work around for this is the following:

$ brew gem install asciidoctor
$ export GEM_HOME=/usr/local/Cellar/gem-asciidoctor/2.0.15
$ export GEM_PATH=/usr/local/Cellar/gem-asciidoctor/2.0.15
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/gem install asciidoctor-diagram

But I think at this point, the use case for using brew gem in this fashion is less desirable.

@marmalodak
Copy link
Author

Thank you for your thoughtful response.

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

2 participants