Closed6

2024-01-12 ごろに gitlab.com で発生するようになった Jekyll ビルドの問題の対策

aikigeaikige

GitLab Pages + Jekyll を使って公開しているWebサイトのビルドが失敗するようになった(2024-01-12現在)原因を確認中。
以下のようなエラーが出ている:

$ bundle exec jekyll build -V -I -d dist --baseurl "$DST_DIR"
/builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll.rb:28: warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of jekyll-4.1.1 to add csv into its gemspec.
/builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb:1: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. Also contact author of safe_yaml-1.0.5 to add base64 into its gemspec.
/builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/liquid-4.0.4/lib/liquid/standardfilters.rb:2: warning: bigdecimal was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add bigdecimal to your Gemfile or gemspec. Also contact author of liquid-4.0.4 to add bigdecimal into its gemspec.
                    ------------------------------------------------
      Jekyll 4.1.1   Please append `--trace` to the `build` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/usr/local/lib/ruby/3.3.0/logger.rb:384:in `level': undefined method `[]' for nil (NoMethodError)
    @level_override[Fiber.current] || @level
                   ^^^^^^^^^^^^^^^
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll/log_adapter.rb:45:in `adjust_verbosity'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll/commands/build.rb:27:in `process'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `each'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/gems/jekyll-4.1.1/exe/jekyll:15:in `<top (required)>'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/bin/jekyll:25:in `load'
	from /builds/seishin-kan-website/seishin-kan-website.gitlab.io/vendor/ruby/3.3.0/bin/jekyll:25:in `<top (required)>'
	from /usr/local/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `load'
	from /usr/local/lib/ruby/3.3.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/local/lib/ruby/3.3.0/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/3.3.0/bundler/cli.rb:451:in `exec'
	from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
	from /usr/local/lib/ruby/3.3.0/bundler/cli.rb:34:in `dispatch'
	from /usr/local/lib/ruby/3.3.0/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /usr/local/lib/ruby/3.3.0/bundler/cli.rb:28:in `start'
	from /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
	from /usr/local/lib/ruby/3.3.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1
aikigeaikige

どうも Docker Image として ruby:latest 利用すると、ruby のバージョンが 3.3 になるようになったようだ。
そして、一方 Jekyll のバージョンは

Installing jekyll 4.1.1

とあるので、4.1.1。
雰囲気として、Ruby のバージョンと、Jekyll のバージョンの相性がよくなさそう。

aikigeaikige
.gitlab-ci.yml
image: ruby:3.2

image を ruby:3.2 に変更して実行。ビルドは成功した。

aikigeaikige

バージョンの問題を考えると、.gitlab-ci.yml で指定する imageruby:latest のようにバージョンが不定になる書き方はしないほうが良いということなのだろう。

このスクラップは4ヶ月前にクローズされました