所以我一直在使用Jekyll和一个名为Chirpy的特定主题构建一个博客网站,并使用Cloudflare Pages部署它,代码存储在一个私有的Github存储库中,所以每当我推送代码时,Cloudflare都会自动生成一个新的构建版本。
几个月来一直运行良好,但在一些更新后,部署新构建失败,原因如下:
12:57:58.188 Success: Finished cloning repository files
12:57:58.890 Installing dependencies
12:57:58.901 Python version set to 2.7
12:58:03.233 v12.18.0 is already installed.
12:58:04.608 Now using node v12.18.0 (npm v6.14.4)
12:58:04.922 Started restoring cached build plugins
12:58:04.937 Finished restoring cached build plugins
12:58:05.597 Attempting ruby version 2.7.1, read from environment
12:58:09.668 Using ruby version 2.7.1
12:58:10.041 Using PHP version 5.6
12:58:10.042 Started restoring cached ruby gems
12:58:10.060 Finished restoring cached ruby gems
12:58:10.062 Installing gem bundle
12:58:10.368 [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '/opt/buildhome/cache/bundle'`, and stop using this flag
12:58:10.526 [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs`
12:58:13.673 Fetching gem metadata from https://rubygems.org/..........
12:58:13.834 Fetching gem metadata from https://rubygems.org/.
12:58:13.935 Resolving dependencies...
12:58:14.019 sass-embedded-1.58.0-x86_64-linux-musl requires rubygems version >= 3.3.22,
12:58:14.019 which is incompatible with the current version, 3.1.2
12:58:14.052 Error during gem install
12:58:14.073 Failed: build command exited with code: 1
12:58:14.848 Failed: an internal error occurred
现在Cloudflare允许您指定要使用哪个命令来执行构建,即:bundle exec jekyll b
我一直在寻找一种方法来更新Cloudflare中使用的Ruby版本,但找不到任何超过this one post的资源。我尝试过更改宝石文件,如:spec.required_ruby_version = ">= 3.0"
,但看起来Cloudflare根本不支持Ruby 3;然后我有了使用Chirpy主题的旧版本的想法,因为我已经有了博客的部署版本,我回到Chirpy 5.2.1,但令人惊讶的是错误仍然存在。
1条答案
按热度按时间zaq34kh61#
正如Christian所提到的,在Gemfile中添加
gem "jekyll-sass-converter", "~> 2.0"
确实解决了这个问题。