asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
432 stars 106 forks source link

Constants DL and Fiddle is not defined. #42

Closed maxandersen closed 9 years ago

maxandersen commented 9 years ago

I've added the following to Gemfile:

gem 'asciidoctor', '1.5.0' gem 'asciidoctor-diagram'

Run bundle update.

Added require 'asciidoctor-diagram' to pipeline.rb

If i do not run 'brew install graphviz' I get #41

When I have run 'brew install graphviz' I get:

"Constants DL and Fiddle is not defined."

When trying to render

[ditaa]
----
                   +-------------+
                   | Asciidoctor |-------+
                   |  Diagram    |       |
                   +-------------+       | PNG out
                       ^                 |
                       | ditaa in        |
                       |                 v
 +--------+   +--------+----+    /----------------\
 |        | --+ Asciidoctor +--> |                |
 |  Text  |   +-------------+    |Beautiful output|
 |Document|   |   !magic!   |    |                |
 |     {d}|   |             |    |                |
 +---+----+   +-------------+    \----------------/
     :                                   ^
     |          Lots of work             |
     +-----------------------------------+
----

Full stacktrace is:

/Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/util/java_rjb.rb:51:in `load'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/util/java_rjb.rb:51:in `load'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/ditaa/extension.rb:11:in `ditaa'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/ditaa/extension.rb:32:in `block (2 levels) in '
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/util/diagram.rb:130:in `call'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/util/diagram.rb:130:in `create_image_block'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/util/diagram.rb:105:in `generate_block'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-diagram-1.2.0/lib/asciidoctor-diagram/util/diagram.rb:23:in `process'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:1084:in `[]'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:1084:in `build_block'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:891:in `next_block'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:303:in `next_section'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:52:in `parse'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:448:in `parse'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1337:in `load'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1415:in `convert'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/handlers/template/asciidoc.rb:20:in `evaluate'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/handlers/base_tilt_handler.rb:130:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/handlers/asciidoctor_handler.rb:87:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/handlers/layout_handler.rb:48:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/page.rb:135:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/page.rb:174:in `content'
          /Users/max/code/jbosstools/jbosstools-website/blog/index.html.haml:47:in `block (2 levels) in singletonclass'
          /Users/max/code/jbosstools/jbosstools-website/blog/index.html.haml:23:in `each'
          /Users/max/code/jbosstools/jbosstools-website/blog/index.html.haml:23:in `block in singletonclass'
          /Users/max/code/jbosstools/jbosstools-website/blog/index.html.haml:65535:in `instance_eval'
          /Users/max/code/jbosstools/jbosstools-website/blog/index.html.haml:65535:in `singletonclass'
          /Users/max/code/jbosstools/jbosstools-website/blog/index.html.haml:65533:in `__tilt_70111851345320'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/tilt-1.4.1/lib/tilt/haml.rb:24:in `evaluate'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/handlers/base_tilt_handler.rb:130:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/handlers/layout_handler.rb:48:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/page.rb:135:in `rendered_content'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/engine.rb:310:in `generate_page'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/engine.rb:380:in `generate_page_internal'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/engine.rb:373:in `block in generate_page_by_output_path'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/engine.rb:372:in `each'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/engine.rb:372:in `generate_page_by_output_path'
          /Users/max/.rvm/gems/ruby-1.9.3-p547@jbosstools-website/gems/awestruct-0.5.4.rc3/lib/awestruct/cli/auto.rb:40:in `block (3 levels) in run'
mojavelinux commented 9 years ago

On Fri, Aug 15, 2014 at 2:24 AM, Max Rydahl Andersen < notifications@github.com> wrote:

Constants DL and Fiddle is not defined

This seems to be a problem in rjb (the Ruby Java bridge).

Here's the line where that error gets thrown: https://github.com/arton/rjb/blob/master/ext/load.c#L134

Could you try on Ruby 2.0 or above (since the commit mentions something about Ruby 2.0)?

I don't think this is an issue in graphviz or Asciidoctor Diagram core...it seems to be an issue in rjb (obviously, we still want to figure it out, just suggesting where to look).

-Dan

Dan Allen | http://google.com/profiles/dan.j.allen

pepijnve commented 9 years ago

@mojavelinux if I'm interpreting the rjb code correctly it's trying to require 'dl' or 'fiddle' and then checking that the 'DL' or 'Fiddle' constants are defined. For some reason I guess that's failing, but I have no idea why. Those are both standard library modules so I wouldn't expect that to fail.

pepijnve commented 9 years ago

@arton If you have some time, could you perhaps shed some light on the situations in which the error at https://github.com/arton/rjb/blob/master/ext/load.c#L134 actually gets raised? I would like to reproduce the scenario described above, but have no idea where to start.

maxandersen commented 9 years ago

Just tried with ruby 2.0 and things then did not fail in this way but hitting #39 instead.

arton commented 9 years ago

Hi pepijnve. I have no idea because if ruby version under 2.0 should have DL and greater or equal 2.0 may have Fiddle. Rjb requires one of them for loading JVM into memory. The code you mentioned is 'if state != 0 then require failed' or 'if DL/Fiddle was not defined then unknown error was happened'. One possibility is using RVM or such environment changer caused conflicts between shared objects and ruby itself.

pepijnve commented 9 years ago

@maxandersen unless you object I'm going to close this issue as not reproducible. I don't know where to start in fixing this if I can't set up a test case for it. It also seems to an rjb and environment combination issue rather than something in the asciidoctor-diagram code that I can fix. Is that ok for you?

mojavelinux commented 9 years ago

I would suggest leaving it open in a milestone called "Deferred" (or similar) and add the label "needs-test" (or similar). That way, people know that a) it could happen and b) we can address it once its reproducible. We don't want to give an impression that a solution was found, or that we completely understand the problem.

pepijnve commented 9 years ago

Ok. Different projects, different practices. At work we use jira and 'resolve' issues like this with 'cannot reproduce'. They tend to stay open indefinitely otherwise and clutter up the issue list. But no objections to leaving it open.

pepijnve commented 9 years ago

@mojavelinux could you create an appropriate label? I can't do that it seems since I'm not the repo owner.

mojavelinux commented 9 years ago

Geez, permissions on GitHub are so overly restrictive. Even though you are the administrator on the repository, the highest permission I can grant you, it doesn't let you do certain things like create labels. So annoying.

Okay, I setup a bunch of labels. If you need more, just let me know (file an issue).

I don't claim to know what I'm doing, but I do know that when I see issues closed in other projects with no code change or troubleshooting steps, I really feel lost. Thus, I want to see if we can tie up all issues that we close that way...and leave issues open that we can't.

You should try to schedule every issue for a milestone (even future), so that unscheduled issues (or those scheduled in Deferred) don't show by default. This helps us plan the project anyway.

Again, if you want to do it another way, no problem. My suggestions shouldn't trump yours...they are just suggestions :)

mojavelinux commented 9 years ago

When I say, "don't show by default", I mean that you would look at issues by milestone instead of just all open issues. Obviously, we can't control what GitHub shows by default :)

pepijnve commented 9 years ago

GitHub only has two issue states so the labels and milestones work for me.

maxandersen commented 9 years ago

I was about to give you a custom fork of https://github.com/jbosstools/jbosstools-website which showed the problem but after I reverted to ruby 1.9 on this things continues to work. gdamn'it ;/

So yeah, i'm okey calling this non-reproducible and closing.

pepijnve commented 9 years ago

Since this can't be reproduced by myself or the reporter of the issue and the RJB maintainer has no idea what might be wrong either I don't think it's useful anymore to keep this issue open (even if we've already marked it as deferred).

mojavelinux commented 9 years ago

Sounds good.

pepijnve commented 9 years ago

I've been able to reproduce this on my local machine.

rbenv install 1.9.3-p484
gem install rjb
irb
Rjb::load([])

This triggers the same error. Looks like this is an Rjb/CRuby 1.9.3/Mac OSX issue. Root cause is not in asciidoctor-diagram. If I find some time to reproduce this in a clean VM I'll report an issue against Rjb.

mojavelinux commented 9 years ago

Thanks for tracking this down, @pepijnve!

(I'm adding this to my list of reasons to encourage folks to upgrade to Ruby 2 & beyond).

pepijnve commented 9 years ago

Resolved by #48