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

Could not generate pdf due to gems load error #22

Open
miaFan opened this issue Jun 13, 2019 · 4 comments
Open

Could not generate pdf due to gems load error #22

miaFan opened this issue Jun 13, 2019 · 4 comments

Comments

@miaFan
Copy link

miaFan commented Jun 13, 2019

My project is using:

  • Spring boot 2.1.2
  • Gradle 4.9
  • org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2
  • org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16

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
Copy link
Member

mojavelinux commented Jun 13, 2019

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

@mojavelinux mojavelinux transferred this issue from asciidoctor/asciidoctor-pdf Jun 13, 2019
@ArjanLem
Copy link

ArjanLem commented Feb 6, 2020

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

@MajdT51
Copy link

MajdT51 commented Feb 9, 2021

Have the same issue.. any updates :)

@kubamarchwicki
Copy link

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'

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

5 participants