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

Fails during generation with "undefined method `[]=' for #<OpenStruct>" #81

Closed
hedgehog opened this issue Jan 7, 2015 · 2 comments
Closed
Assignees

Comments

@hedgehog
Copy link

hedgehog commented Jan 7, 2015

I've got asciidoctor-pdf crashing during generation. I've been able to reproduce using the following minimal test case. I've added the spine structure in response to asciidoctor/asciidoctor-epub3#7

Parent:

$ cat adoc/spine_bug.adoc
= Asciidoctor PDF: Sample Book
Author Name
v1.0, 2014-04-15

include::bug.adoc[]

Child:

$ cat adoc/bug.adoc
== Hello World

Full trace:

$ ruby -S asciidoctor-pdf --trace adoc/spine_bug.adoc
An exception occurred running /media/sf_host_docs/cubic/docs/data_dictionary/bin/asciidoctor-pdf:

undefined method `[]=' for #<OpenStruct> (NoMethodError)

Backtrace:

/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/theme_loader.rb:0:in `load'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/theme_loader.rb:36:in `load'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/theme_loader.rb:34:in `load'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/theme_loader.rb:30:in `load_file'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/theme_loader.rb:25:in `load_theme'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/converter.rb:149:in `init_pdf'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/converter.rb:90:in `convert_document'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/lib/asciidoctor-pdf/converter.rb:65:in `convert'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-1.5.2/lib/asciidoctor/document.rb:1028:in `convert'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1499:in `convert'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-1.5.2/lib/asciidoctor/cli/invoker.rb:94:in `invoke!'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-1.5.2/lib/asciidoctor/cli/invoker.rb:86:in `invoke!'
/home/hedge/.bundles/data_dictionary/rbx/2.1/gems/asciidoctor-pdf-1.5.0.alpha.6/bin/asciidoctor-pdf:13:in `__script__'
/media/sf_host_docs/cubic/docs/data_dictionary/bin/asciidoctor-pdf:16:in `__script__'
      OpenStruct#[]= (method_missing) at /home/hedge/.rubies/rbx-2.4.1/gems
                                         /gems/rubysl-ostruct-2.0.4/lib/rubysl
                                         /ostruct/ostruct.rb:196
 { } in Asciidoctor::Pdf::ThemeLoader#load at /home/hedge/.bundles
                                              /data_dictionary/rbx/2.1/gems
                                              /asciidoctor-pdf-1.5.0.alpha.6/lib
                                              /asciidoctor-pdf
                                              /theme_loader.rb+59
                             Hash#each at kernel/common/hash.rb:342
 { } in Asciidoctor::Pdf::ThemeLoader#load at /home/hedge/.bundles
                                              /data_dictionary/rbx/2.1/gems
                                              /asciidoctor-pdf-1.5.0.alpha.6/lib
                                              /asciidoctor-pdf
                                              /theme_loader.rb:36
        { } in Enumerable(Hash)#inject at kernel/common/enumerable.rb:317
                             Hash#each at kernel/common/hash.rb:342
               Enumerable(Hash)#inject at kernel/common/enumerable.rb:312
   Asciidoctor::Pdf::ThemeLoader#load at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems
                                         /asciidoctor-pdf-1.5.0.alpha.6/lib
                                         /asciidoctor-pdf/theme_loader.rb:34
 Asciidoctor::Pdf::ThemeLoader.load_file at /home/hedge/.bundles
                                            /data_dictionary/rbx/2.1/gems
                                            /asciidoctor-pdf-1.5.0.alpha.6/lib
                                            /asciidoctor-pdf/theme_loader.rb:30
 Asciidoctor::Pdf::ThemeLoader.load_theme at /home/hedge/.bundles
                                             /data_dictionary/rbx/2.1/gems
                                             /asciidoctor-pdf-1.5.0.alpha.6/lib
                                             /asciidoctor-pdf/theme_loader.rb:25
 Asciidoctor::Pdf::Converter#init_pdf at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems
                                         /asciidoctor-pdf-1.5.0.alpha.6/lib
                                         /asciidoctor-pdf/converter.rb:149
 Asciidoctor::Pdf::Converter#convert_document at /home/hedge/.bundles
                                                 /data_dictionary/rbx/2.1/gems
                                                 /asciidoctor-pdf-1.5.0.alpha.6
                                                 /lib/asciidoctor-pdf
                                                 /converter.rb:90
  Asciidoctor::Pdf::Converter#convert at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems
                                         /asciidoctor-pdf-1.5.0.alpha.6/lib
                                         /asciidoctor-pdf/converter.rb:65
        Asciidoctor::Document#convert at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems/asciidoctor-1.5.2/lib
                                         /asciidoctor/document.rb:1028
                  Asciidoctor.convert at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems/asciidoctor-1.5.2/lib
                                         /asciidoctor.rb:1499
 { } in Asciidoctor::Cli::Invoker#invoke! at /home/hedge/.bundles
                                             /data_dictionary/rbx/2.1/gems
                                             /asciidoctor-1.5.2/lib/asciidoctor
                                             /cli/invoker.rb:94
                            Array#each at kernel/bootstrap/array.rb:76
    Asciidoctor::Cli::Invoker#invoke! at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems/asciidoctor-1.5.2/lib
                                         /asciidoctor/cli/invoker.rb:86
                    Object#__script__ at /home/hedge/.bundles/data_dictionary
                                         /rbx/2.1/gems
                                         /asciidoctor-pdf-1.5.0.alpha.6/bin
                                         /asciidoctor-pdf:13
                   Kernel(Object)#load at kernel/common/kernel.rb:497
                     Object#__script__ at bin/asciidoctor-pdf:16
      Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
      Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152
               Rubinius::Loader#script at kernel/loader.rb:645
                 Rubinius::Loader#main at kernel/loader.rb:799
direnv: loading ~/.direnvrc
direnv: loading .envrc
direnv: using ruby
direnv: export ~PATH
@mojavelinux
Copy link
Member

Asciidoctor PDF is not known to work with Rubinius and is not tested. Before we start playing whack-a-mole trying to sort out the root cause of this error, we need to get a proper test suite setup (#37). Then, we can run the tests on all the Ruby versions like we do with Asciidoctor core and be confident we aren't breaking things :)

When I try to run Asciidoctor PDF with Rubinius, I get a different error ("OpenURI is not a module, but a Autoload"), so I'm not able to debug this specific issue yet.

@mojavelinux mojavelinux added this to the v1.5.0 milestone Jan 7, 2015
@mojavelinux
Copy link
Member

Btw, thanks for reporting!

@mojavelinux mojavelinux modified the milestones: v1.5.1, v1.5.0 May 17, 2015
@mojavelinux mojavelinux modified the milestones: v1.5.0, v1.5.1 Jun 16, 2015
@mojavelinux mojavelinux self-assigned this Jun 16, 2015
mojavelinux added a commit that referenced this issue Jun 17, 2015
resolves #81 add missing methods on ostruct for Rubinius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants