Skip to content

Fails to require GEMs #718

@markslater

Description

@markslater

I'm having some difficulty requiring GEMs, using the example from the documentation.

Here's my build script:

buildscript {
    repositories {
        mavenCentral()
    }
}

plugins {
    id("org.asciidoctor.jvm.convert") version "4.0.2"
    id("org.asciidoctor.jvm.gems") version "4.0.2"
}

repositories {
    mavenCentral()
    ruby {
        gems()
    }
}

dependencies {
    asciidoctorGems("rubygems:asciidoctor-revealjs:1.1.3")
}

asciidoctorj {
    requires("asciidoctor-revealjs")
}

tasks {
    asciidoctor {
        dependsOn("asciidoctorGemsPrepare")
    }
}

And here's the output:

$ ./gradlew asciidoctor
Successfully installed thread_safe-0.3.6-java
Successfully installed asciidoctor-1.5.8
Successfully installed asciidoctor-revealjs-1.1.3
3 gems installed

> Task :asciidoctor
Exception in thread "main" org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-revealjs
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1017)
        at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85)
        at RUBY.<main>(<script>:1)

> Task :asciidoctor FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':asciidoctor'.
> Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 14s
2 actionable tasks: 2 executed

I'm running:

$ ./gradlew --version

------------------------------------------------------------
Gradle 8.6
------------------------------------------------------------

Build time:   2024-02-02 16:47:16 UTC
Revision:     d55c486870a0dc6f6278f53d21381396d0741c6e

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          11.0.21 (Ubuntu 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OS:           Linux 5.15.0-97-generic amd64

I'm guessing there's some problem with the Ruby path configuration because I see:

$ ls build/.asciidoctorGems/gems/
asciidoctor-1.5.8  asciidoctor-revealjs-1.1.3  thread_safe-0.3.6-java

I'm very new to Asciidoctor, so apologies if I've missed something obvious. Full reproducer here

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions