网络化部署"failed during stage 'building site': Build script returned non-zero exit code: 42"



我试图将我的jekyll静态站点部署到Netlify(通过github(,但没有成功。

错误消息是:

"舞台'建筑站点'失败:构建脚本返回非零 退出代码: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已达到寿命,不应再使用。

我犯了一个错误,认为Ruby Sass是需要解决的问题。附加了我的gemfile和gemfile.lock(以及netlify log(之后,@Jaydorsey友好地建议(在下面的回答中(Ruby Sass不是问题。

最终更新:找到解决方案

专门使用NetLify错误代码" 42"搜索后,我找到了此帖子(https://jameshfisher.com/2019/01/01/09/how-to-foid-fix-fix-activation-activating-bundler-2-failler-2-fail- failed-error - 在您的jekyll-build/(中立即解决了错误。

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

BUNDLED WITH
   2.0.2

来自我的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将拾取使用sassc而不是sass的版本,并让您超越您看到的警告

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

如果那不起作用,请首先尝试在本地建立您的网站,然后查看是否遇到任何错误

相关内容

  • 没有找到相关文章

最新更新