I have tried to deploy my Jekyll static site to Netlify (via GitHub) and it was unsuccessful.
The error message was:
"failed during stage 'building site': Build script returned non-zero exit code: 42"
The following was the full Netlify log:
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.
As the last statement of the log was:
Ruby Sass has reached end-of-life and should no longer be used.
I've made the mistake of thinking that Ruby Sass was the problem that required a resolution. After attaching my Gemfile and Gemfile.lock (as well as the Netlify log), @JayDorsey has kindly advised (in his answer below) that the Ruby Sass wasn't the problem.
FINAL UPDATE: SOLUTION FOUND
After searching specifically with the Netlify error code "42", I have found this post (https://jameshfisher.com/2019/01/09/how-to-fix-activating-bundler-2-failed-error-in-your-jekyll-build/) and that has resolved the error right away.
The solution that worked for me was the removal of
BUNDLED WITH
2.0.2
from my Gemfile.lock.
The following is my original Gemfile.lock and you can notice that it ends with the code that has to be removed:
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
The error you're seeing should just be a warning and shouldn't impact deployment. I'd double-check the netlify logs again and see if there's another error you can find.
The latest published version of jekyll-sass-converter still uses the
sass
gem. It looks like they haven't released a new version that usessassc
yet.If you add the below to your Gemfile, and then run
bundle install
, Jekyll will pick up the version that usessassc
instead ofsass
and get you past the warning you seeIf that doesn't work, try and build your site locally first and see if you get any errors