Bundler:无法加载命令:jekyll(/usr/gem/bin/jekyll)
我正在尝试将我的jekyll网站部署到Codeberg页面。我正在使用一个叫做Woodpecker的CI。我
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
悲伤地写了这条管道,当CI运行它时,我遇到了这个错误:
+ 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>'
为什么会发生这种错误?谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我的情况下,强制使用Bundler版本
2.2.x
并使用bundle exec
而不是直接与GEM相关的命令,请解决问题。此外,您可以确保正在使用用于安装依赖项的相同版本的Bundler。让我们检查
gemfile.lock
文件的最后几行,例如:In my case forcing the usage of bundler version
2.2.x
and usingbundle 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.: