报错信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
02:23:09.362	[!] There was an error parsing `Gemfile`: 
02:23:09.362 [!] There was an error while loading `minima.gemspec`: invalid byte sequence in US-ASCII. Bundler cannot continue.
02:23:09.363
02:23:09.363 # from /opt/buildhome/repo/minima.gemspec:15
02:23:09.363 # -------------------------------------------
02:23:09.363 #
02:23:09.363 > spec.files = `git ls-files -z`.split("\x0").select do |f|
02:23:09.363 # f.match(%r!^(assets|_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))!i)
02:23:09.363 # -------------------------------------------
02:23:09.363 . Bundler cannot continue.
02:23:09.364
02:23:09.364 # from /opt/buildhome/repo/Gemfile:4
02:23:09.364 # -------------------------------------------
02:23:09.364 # source "https://rubygems.org"
02:23:09.364 > gemspec
02:23:09.364 #
02:23:09.364 # -------------------------------------------
02:23:09.370 Error: Exit with error code: 14
02:23:09.370 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
02:23:09.370 at Object.onceWrapper (node:events:652:26)
02:23:09.370 at ChildProcess.emit (node:events:537:28)
02:23:09.370 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
02:23:09.379 Failed: build command exited with code: 1
02:23:10.208 Failed: error occurred while running build command

解决办法:

minima.gemspec 修改如下:

1
2
3
4
5
6
# spec.files = `git ls-files -z`.split("\x0").select do |f|
# f.match(%r!^(assets|_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))!i)
# end
spec.files = Dir["**/*"].select do |f|
f.match(%r!^(assets|_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))!i)
end

其他

环境变量

  • JEKYLL_ENVproduction 用于开启评论^1
  • UNSTABLE_PRE_BUILD:可用于运行命令,如更新插件可安装更新的 ruby 版本 asdf plugin update ruby^2

封面出处: 葉玖洛-哔哩哔哩