You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jekyll-theme-chirpy构建失败:Bundle进程退出码16问题求助

Jekyll-theme-chirpy 服务器端构建失败(Bundle退出码16)解决方案

本地使用jekyll-theme-chirpy主题构建可正常运行,但服务器端构建失败,报错Bundle进程退出码16。已知需固定Bundler版本适配服务器环境,以下是具体操作方案:

错误日志

Error: The process '/opt/hostedtoolcache/Ruby/3.1.2/x64/bin/bundle' failed with exit code 16
    at ExecState._setResult (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:6023:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:6006:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:5900:27)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

本地环境信息

$ which jekyll
>>> /Users/GyeongminKim/.rbenv/shims/jekyll
$ which gem
>>> /Users/GyeongminKim/.rubies/ruby-3.1.2/bin/gem
$ which bundle
>>> /Users/GyeongminKim/.rubies/ruby-3.1.2/bin/bundle
$ bundle version
>>> Bundler version 2.3.7 (2022-09-15 commit unknown)
$ ruby --version
>>> ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]

具体解决步骤

1. 直接在构建脚本中指定Bundler版本

在服务器端的构建命令前,先安装本地使用的2.3.7版本Bundler,再用该版本执行依赖安装:

gem install bundler:2.3.7
bundle _2.3.7_ install

2. 适配GitHub Actions环境(针对你的错误日志场景)

如果使用GitHub Actions进行构建,修改.github/workflows下的CI配置文件,在setup-ruby步骤中添加bundler-version参数,强制使用指定版本:

- name: Set up Ruby
  uses: ruby/setup-ruby@v1
  with:
    ruby-version: '3.1.2'
    bundler-version: '2.3.7' # 与本地版本一致
    bundler-cache: true

3. 锁定Gemfile.lock中的平台与Bundler版本

本地执行以下命令,为服务器平台(x86_64-linux)生成适配的锁文件,确保服务器端使用与本地一致的依赖版本:

bundle lock --add-platform x86_64-linux

执行完成后,将更新后的Gemfile.lock提交到代码仓库。

内容的提问来源于stack exchange,提问作者KimGyeongMin-KR

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 07:20:37