首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >bundler:未能加载命令: jekyll (/usr/gem/bin/jekyll)

bundler:未能加载命令: jekyll (/usr/gem/bin/jekyll)
EN

Stack Overflow用户
提问于 2022-06-23 20:42:10
回答 1查看 365关注 0票数 0

我正在尝试将我的Jekyll站点部署到Codeberg页面。我用的是一种叫啄木鸟的CI。我写了这条管道

代码语言:javascript
运行
复制
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运行时,我得到了这个错误:

代码语言:javascript
运行
复制
+ 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>'

为什么会发生这种情况?谢谢。

EN

回答 1

Stack Overflow用户

发布于 2022-10-10 10:18:49

在我的例子中,强制使用2.2.x版本的绑定器,直接使用bundle exec而不是与宝石相关的命令,解决了这个问题。

此外,您还可以确保使用的绑定器版本与安装依赖项的版本相同。让我们检查一下Gemfile.lock文件的最后几行,例如:

代码语言:javascript
运行
复制
...

BUNDLED WITH
   2.2.14
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72736333

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档