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

EPUB generation failing since docker-asciidoctor:1.64 version with error "cannot load such file -- nokogiri/nokogiri" #430

Open
sivaprasadreddy opened this issue Mar 5, 2024 · 7 comments
Assignees
Labels

Comments

@sivaprasadreddy
Copy link

sivaprasadreddy commented Mar 5, 2024

I am using docker-asciidoctor to generate PDF, HTML an EPUB formats and it was working fine until 1.63 version.

docker run --rm -v $(pwd):/documents/:z asciidoctor/docker-asciidoctor:1.63 asciidoctor -o build/mybook.html src/index.adoc

docker run --rm -v $(pwd):/documents/:z asciidoctor/docker-asciidoctor:1.63 asciidoctor-pdf -o build/mybook.pdf src/index.adoc

docker run --rm -v $(pwd):/documents/:z asciidoctor/docker-asciidoctor:1.63 asciidoctor-epub3 -o build/mybook.epub src/index.adoc

When I try to upgrade docker-asciidoctor version to 1.64 or any newer, I am getting the following error ONLY FOR EPUB:

<internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:159:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:159:in `rescue in require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:39:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/extension.rb:31:in `rescue in <top (required)>'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/extension.rb:4:in `<top (required)>'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri.rb:8:in `require_relative'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri.rb:8:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/gepub-1.0.15/lib/gepub/meta.rb:2:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/gepub-1.0.15/lib/gepub.rb:8:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/asciidoctor-epub3-2.1.0/lib/asciidoctor-epub3.rb:5:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/asciidoctor-epub3-2.1.0/bin/asciidoctor-epub3:5:in `<top (required)>'
        from /usr/bin/asciidoctor-epub3:25:in `load'
        from /usr/bin/asciidoctor-epub3:25:in `<main>'
<internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/extension.rb:31:in `rescue in <top (required)>'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/extension.rb:4:in `<top (required)>'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri.rb:8:in `require_relative'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri.rb:8:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/gepub-1.0.15/lib/gepub/meta.rb:2:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/gepub-1.0.15/lib/gepub.rb:8:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/asciidoctor-epub3-2.1.0/lib/asciidoctor-epub3.rb:5:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/asciidoctor-epub3-2.1.0/bin/asciidoctor-epub3:5:in `<top (required)>'
        from /usr/bin/asciidoctor-epub3:25:in `load'
        from /usr/bin/asciidoctor-epub3:25:in `<main>'
/usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/extension.rb:7:in `require_relative': Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/3.2/nokogiri.so) - /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/3.2/nokogiri.so (LoadError)
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri/extension.rb:7:in `<top (required)>'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri.rb:8:in `require_relative'
        from /usr/lib/ruby/gems/3.2.0/gems/nokogiri-1.16.1-aarch64-linux/lib/nokogiri.rb:8:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/gepub-1.0.15/lib/gepub/meta.rb:2:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/gepub-1.0.15/lib/gepub.rb:8:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/asciidoctor-epub3-2.1.0/lib/asciidoctor-epub3.rb:5:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/lib/ruby/gems/3.2.0/gems/asciidoctor-epub3-2.1.0/bin/asciidoctor-epub3:5:in `<top (required)>'
        from /usr/bin/asciidoctor-epub3:25:in `load'
        from /usr/bin/asciidoctor-epub3:25:in `<main>'
@barthel
Copy link
Contributor

barthel commented Jun 7, 2024

gem list nokogiri

*** LOCAL GEMS ***

nokogiri (1.16.5 aarch64-linux, 1.13.10)
asciidoctor-fb2-0.7.0 depends on fb2rb (>= 0.6, < 0.8)
fb2rb-0.7.0 depends on nokogiri (>= 1.10, < 1.14)

Using fb2rb 0.8.0 could fix this issue but there is no asciidoctor-fb2 using this.

As a fix, the asciidoctor-fb2 should be removed on arm64 instead of nokogiri only:

&& if [[ ${TARGETARCH} == arm64 ]]; then gem uninstall nokogiri -v '1.16.0'; fi

Or change the nokogiri version to remove to like '> 1.14' because the installed version is 1.16.5 and not 1.16.0 and this version will not removed.

gem uninstall nokogiri -v '> 1.14'

barthel added a commit to barthel/docker-asciidoctor that referenced this issue Jun 7, 2024
Uninstall nokogiri 1.16.x because of error "cannot load such file"
asciidoctor/docker-asciidoctor#430
barthel added a commit to barthel/docker-asciidoctor that referenced this issue Jun 7, 2024
Uninstall nokogiri 1.16.x because of error "cannot load such file"
asciidoctor/docker-asciidoctor#430
barthel added a commit to barthel/docker-asciidoctor that referenced this issue Jun 7, 2024
Uninstall nokogiri 1.16.x because of error "cannot load such file"
asciidoctor/docker-asciidoctor#430
@igr
Copy link

igr commented Jun 23, 2024

Is there a workaround? Quite an annoying problem that is not being solved yet

@dunyakirkali
Copy link

I'm having the same issue with the latest docker image

@barthel
Copy link
Contributor

barthel commented Sep 15, 2024

@dduportal
Copy link
Contributor

(reopening until we have confirmation the problem is fixed for everyone)

@dduportal
Copy link
Contributor

Hi @sivaprasadreddy @igr @dunyakirkali ! Thanks to @barthel 's contribution, a first fix has been issued: can you tell us if the version 1.77.0 (released today with the aforementioned fix) is working for you or not please?

@dunyakirkali
Copy link

1.77.0 works now.

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants