0

I'm trying to deploy my Jekyll site to Codeberg Pages. I'm using a CI called Woodpecker. I wrote this pipeline

pipeline:
  publish:
    image: jekyll/jekyll
    secrets: [ codeberg_access_token ]
    commands:
      - bundle exec jekyll build
      - cd _site
      - git init
      - git remote add up $CODEBERG_ACCESS_TOKEN@https://codeberg.org/mikwee/pages.git
      - git push -u up master -f

Sadly, I got this error when the CI ran it:

+ bundle exec jekyll build
bundler: failed to load command: jekyll (/usr/gem/bin/jekyll)
/usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/resolver.rb:271:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'github-pages' in locally installed gems. (Bundler::GemNotFound)
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/resolver.rb:254:in `map!'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/resolver.rb:254:in `verify_gemfile_dependencies_are_found!'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/resolver.rb:50:in `start'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/resolver.rb:24:in `resolve'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/definition.rb:270:in `resolve'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/definition.rb:473:in `materialize'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/definition.rb:191:in `specs'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/definition.rb:239:in `specs_for'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/runtime.rb:18:in `setup'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler.rb:162:in `setup'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/setup.rb:20:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/ui/shell.rb:136:in `with_level'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/ui/shell.rb:88:in `silence'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/setup.rb:20:in `<top (required)>'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:56:in `require_relative'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:56:in `kernel_load'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:23:in `run'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:483:in `exec'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:31:in `dispatch'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/cli.rb:25:in `start'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/exe/bundle:48:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.15/exe/bundle:36:in `<top (required)>'
from /usr/local/bin/bundle:25:in `load'
from /usr/local/bin/bundle:25:in `<main>'

Why is this happening? Thank you.

mikwee
  • 133
  • 2
  • 14
  • 1
    I'm finding that screen shot very difficult to read, and I can't copy out the error message to search for it in other places. Can you please [edit] the question to replace the image with the actual text of the error? Do you know which step in the pipeline is causing the problem? – David Maze Jun 24 '22 at 10:14
  • Finally found a way to easily copy paste it, so done! – mikwee Jun 24 '22 at 12:36
  • Do you need to run `bundle install` before `bundle exec jekyll build` in the commands list? – juicy-g Jun 27 '22 at 00:58
  • Added this, got [this error](https://pastebin.com/R32apEyJ). – mikwee Jun 28 '22 at 20:20

1 Answers1

1

In my case forcing the usage of bundler version 2.2.x and using bundle exec instead of gem-related command directly, solved the issue.

Additionally, you can make sure that you're using the same version of bundler that has been used for installing dependencies. Let's check the last couple of lines of your Gemfile.lock file, e.g.:

...

BUNDLED WITH
   2.2.14