gpt4 book ai didi

ruby - Netlify 部署 "failed during stage ' 构建站点' : Build script returned non-zero exit code: 42"

转载 作者:数据小太阳 更新时间:2023-10-29 07:38:48 26 4
gpt4 key购买 nike

我尝试将我的 Jekyll 静态站点部署到 Netlify(通过 GitHub),但没有成功。

错误信息是:

"failed during stage 'building site': Build script returned non-zero exit code: 42"

以下是完整的 Netlify 日志:

5:06:23 PM: Preparing Git Reference refs/heads/master
5:06:23 PM: Starting build script
5:06:23 PM: Installing dependencies
5:06:24 PM: Downloading and installing node v10.16.0...
5:06:25 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
5:06:25 PM:
##########################
5:06:25 PM: 37.2%
5:06:25 PM:
##########################################
5:06:25 PM: 58.4%
5:06:25 PM:
################################################
5:06:25 PM: ######################## 100.0%
5:06:25 PM: Computing checksum with sha256sum
5:06:25 PM: Checksums matched!
5:06:28 PM: Now using node v10.16.0 (npm v6.9.0)
5:06:28 PM: Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION.
5:06:28 PM: Attempting ruby version 2.6.2, read from environment
5:06:29 PM: Using ruby version 2.6.2
5:06:29 PM: Using PHP version 5.6
5:06:29 PM: Started restoring cached ruby gems
5:06:29 PM: Finished restoring cached ruby gems
5:06:29 PM: Installing gem bundle
5:06:30 PM: Warning: the running version of Bundler (2.0.1) is older than the version that created the lockfile (2.0.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
5:06:31 PM: Fetching gem metadata from https://rubygems.org/
5:06:33 PM: Fetching public_suffix 3.1.1
5:06:33 PM: Installing public_suffix 3.1.1
5:06:33 PM: Fetching addressable 2.6.0
5:06:33 PM: Installing addressable 2.6.0
5:06:33 PM: Using bundler 2.0.1
5:06:33 PM: Fetching colorator 1.1.0
5:06:33 PM: Installing colorator 1.1.0
5:06:33 PM: Fetching concurrent-ruby 1.1.5
5:06:33 PM: Installing concurrent-ruby 1.1.5
5:06:33 PM: Fetching eventmachine 1.2.7
5:06:33 PM: Installing eventmachine 1.2.7 with native extensions
5:06:49 PM: Fetching http_parser.rb 0.6.0
5:06:49 PM: Installing http_parser.rb 0.6.0 with native extensions
5:06:50 PM: Fetching em-websocket 0.5.1
5:06:50 PM: Installing em-websocket 0.5.1
5:06:50 PM: Fetching ffi 1.11.1
5:06:51 PM: Installing ffi 1.11.1 with native extensions
5:06:59 PM: Fetching forwardable-extended 2.6.0
5:06:59 PM: Installing forwardable-extended 2.6.0
5:06:59 PM: Fetching i18n 0.9.5
5:06:59 PM: Installing i18n 0.9.5
5:06:59 PM: Fetching rb-fsevent 0.10.3
5:07:00 PM: Installing rb-fsevent 0.10.3
5:07:00 PM: Fetching rb-inotify 0.10.0
5:07:00 PM: Installing rb-inotify 0.10.0
5:07:00 PM: Fetching sass-listen 4.0.0
5:07:00 PM: Installing sass-listen 4.0.0
5:07:00 PM: Fetching sass 3.7.4
5:07:00 PM: Installing sass 3.7.4
5:07:00 PM: Fetching jekyll-sass-converter 1.5.2
5:07:00 PM: Installing jekyll-sass-converter 1.5.2
5:07:00 PM: Fetching ruby_dep 1.5.0
5:07:00 PM: Installing ruby_dep 1.5.0
5:07:00 PM: Fetching listen 3.1.5
5:07:00 PM: Installing listen 3.1.5
5:07:00 PM: Fetching jekyll-watch 2.2.1
5:07:00 PM: Installing jekyll-watch 2.2.1
5:07:00 PM: Fetching kramdown 1.17.0
5:07:01 PM: Installing kramdown 1.17.0
5:07:01 PM: Fetching liquid 4.0.3
5:07:01 PM: Installing liquid 4.0.3
5:07:01 PM: Fetching mercenary 0.3.6
5:07:01 PM: Installing mercenary 0.3.6
5:07:01 PM: Fetching pathutil 0.16.2
5:07:01 PM: Installing pathutil 0.16.2
5:07:01 PM: Fetching rouge 3.5.1
5:07:02 PM: Installing rouge 3.5.1
5:07:02 PM: Fetching safe_yaml 1.0.5
5:07:02 PM: Installing safe_yaml 1.0.5
5:07:02 PM: Fetching jekyll 3.8.5
5:07:02 PM: Installing jekyll 3.8.5
5:07:02 PM: Fetching jekyll-feed 0.12.1
5:07:02 PM: Installing jekyll-feed 0.12.1
5:07:02 PM: Fetching jekyll-paginate 1.1.0
5:07:02 PM: Installing jekyll-paginate 1.1.0
5:07:02 PM: Fetching jekyll-seo-tag 2.6.1
5:07:02 PM: Installing jekyll-seo-tag 2.6.1
5:07:02 PM: Fetching jekyll-sitemap 1.3.1
5:07:05 PM: failed during stage 'building site': Build script returned non-zero exit code: 42
5:07:02 PM: Installing jekyll-sitemap 1.3.1
5:07:02 PM: Bundle complete! 4 Gemfile dependencies, 30 gems now installed.
5:07:02 PM: Bundled gems are installed into `/opt/build/cache/bundle`
5:07:02 PM: Post-install message from sass:
5:07:02 PM: Ruby Sass has reached end-of-life and should no longer be used.

日志的最后一条语句是:

Ruby Sass has reached end-of-life and should no longer be used.

我错误地认为 Ruby Sass 是需要解决的问题。附上我的 Gemfile 和 Gemfile.lock(以及 Netlify 日志)后,@JayDorsey友善地建议(在他下面的回答中)Ruby Sass 不是问题所在。

最终更新:找到解决方案

在专门搜索 Netlify 错误代码“42”后,我找到了这篇文章 ( https://jameshfisher.com/2019/01/09/how-to-fix-activating-bundler-2-failed-error-in-your-jekyll-build/ ),并且立即解决了错误。

对我有用的解决方案是删除

BUNDLED WITH
2.0.2

来 self 的 Gemfile.lock。

以下是我原来的 Gemfile.lock,你可以注意到它以必须删除的代码结尾:

GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.1.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x64-mingw32)
ffi (1.11.1)
ffi (1.11.1-x64-mingw32)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.5)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-feed (0.12.1)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-sitemap (1.3.1)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (1.17.0)
liquid (4.0.3)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (3.5.1)
ruby_dep (1.5.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)

PLATFORMS
ruby
x64-mingw32

DEPENDENCIES
jekyll-feed
jekyll-paginate
jekyll-seo-tag
jekyll-sitemap

RUBY VERSION
ruby 2.6.2p47

BUNDLED WITH
2.0.2

最佳答案

您看到的错误应该只是一个警告,不应影响部署。我会再次仔细检查 netlify 日志,看看是否还有其他错误。

jekyll-sass-converter 的最新发布 版本仍然使用 sass gem。看起来他们还没有发布使用 sassc 的新版本。

如果您将以下内容添加到您的 Gemfile,然后运行 ​​bundle install,Jekyll 将选择使用 sass 而不是 sass 的版本> 让你通过你看到的警告

gem 'jekyll-sass-converter', git: 'https://github.com/jekyll/jekyll-sass-converter', branch: 'master'

如果这不起作用,请先尝试在本地构建您的网站,看看是否有任何错误

关于ruby - Netlify 部署 "failed during stage ' 构建站点' : Build script returned non-zero exit code: 42",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56793964/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com