asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
36 stars 17 forks source link

Could not generate pdf due to gems load error #22

Open miaFan opened 5 years ago

miaFan commented 5 years ago

My project is using:

When I am trying to generate pdf: uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1:in 'require': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby. Exception in thread "main" org.asciidoctor.gradle.backported.AsciidoctorRemoteExecutionException: Error running Asciidoctor whilst attempting to process /xxx/src/docs/asciidoc/index.adoc using backend pdf at org.asciidoctor.gradle.backported.AsciidoctorJavaExec$_convertFiles_closure3.doCall(AsciidoctorJavaExec.groovy:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) at groovy.lang.Closure.call(Closure.java:414) at groovy.lang.Closure.call(Closure.java:430) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2078) at org.asciidoctor.gradle.backported.AsciidoctorJavaExec.convertFiles(AsciidoctorJavaExec.groovy:56) at org.asciidoctor.gradle.backported.AsciidoctorJavaExec.access$0(AsciidoctorJavaExec.groovy) at org.asciidoctor.gradle.backported.AsciidoctorJavaExec$_run_closure2.doCall(AsciidoctorJavaExec.groovy:50) at org.asciidoctor.gradle.backported.AsciidoctorJavaExec$_run_closure2.call(AsciidoctorJavaExec.groovy) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2066) at org.asciidoctor.gradle.backported.AsciidoctorJavaExec.run(AsciidoctorJavaExec.groovy:48) at org.asciidoctor.gradle.backported.AsciidoctorJavaExec.main(AsciidoctorJavaExec.groovy:195)

Caused by: org.jruby.exceptions.RaiseException: (LoadError) load error: psych -- java.lang.ExceptionInInitializerError: null at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55) at RUBY.<main>(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/yaml.rb:6) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.(root)(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1) at RUBY.<main>(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.(root)(uri:classloader:/gems/prawn-icon-1.3.0/lib/prawn/icon/font_data.rb:9) at RUBY.<main>(uri:classloader:/jruby/kernel/kernel.rb:1) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.require_relative(uri:classloader:/jruby/kernel/kernel.rb:13) at RUBY.<main>(uri:classloader:/gems/prawn-icon-1.3.0/lib/prawn/icon.rb:10) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.(root)(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1) at RUBY.<main>(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.(root)(uri:classloader:/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn_ext/extensions.rb:3) at RUBY.<main>(uri:classloader:/jruby/kernel/kernel.rb:1) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.require_relative(uri:classloader:/jruby/kernel/kernel.rb:13) at RUBY.<main>(uri:classloader:/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn_ext.rb:5) at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:956) at RUBY.(root)(uri:classloader:/jruby/kernel/kernel.rb:1) at RUBY.<main>(uri:classloader:/jruby/kernel/kernel.rb:13)

However, on the same machine, I can run this demo: https://github.com/Swagger2Markup/spring-swagger2markup-demo which is using spring 1.4.

mojavelinux commented 5 years ago

This looks like an issue with AsciidoctorJ / Java, so I'm going to move it to asciidoctorj-pdf.

ArjanLem commented 4 years ago

I hit the same issue: 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1' classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-rc.3'

MajdT51 commented 3 years ago

Have the same issue.. any updates :)

kubamarchwicki commented 3 years ago

Updating dependencies fixed the problem

group = 'org.asciidoctor', module = 'asciidoctorj', version = '2.4.2'
group = 'org.asciidoctor', module = 'asciidoctorj-pdf', version = '1.5.4'
group = 'org.jruby', module = 'jruby', version = '9.2.13.0'