Home
Support Forums

Build can’t install Ruby after upgrade to new image

Site: https://segdeha-playground.netlify.app

TL;dr, I upgraded to the latest build image from an old “Trusty” image and now it can’t install Ruby, causing the build to fail.

Build log:

6:47:51 PM: Build ready to start
6:47:53 PM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
6:47:53 PM: build-image tag: v4.3.0
6:47:53 PM: buildbot version: fd60e21d56897195475b3dbb3e1c495894eb873c
6:47:53 PM: Building without cache
6:47:53 PM: Starting to prepare the repo for build
6:47:53 PM: No cached dependencies found. Cloning fresh repo
6:47:53 PM: git clone https://github.com/segdeha/playground
6:47:54 PM: Preparing Git Reference refs/heads/master
6:47:54 PM: Parsing package.json dependencies
6:47:54 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus './build' in the Netlify UI
6:47:55 PM: Starting build script
6:47:55 PM: Installing dependencies
6:47:55 PM: Python version set to 2.7
6:47:55 PM: Downloading and installing node v8.17.0...
6:47:56 PM: Downloading https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz...
6:47:56 PM: Computing checksum with sha256sum
6:47:56 PM: Checksums matched!
6:47:58 PM: Now using node v8.17.0 (npm v6.13.4)
6:47:58 PM: Started restoring cached build plugins
6:47:58 PM: Finished restoring cached build plugins
6:47:58 PM: Attempting ruby version 2.3.6, read from environment
6:47:59 PM: Required ruby-2.3.6 is not installed - installing.
6:47:59 PM: Searching for binary rubies, this might take some time.
6:48:00 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.3.6.tar.bz2
6:48:00 PM: Checking requirements for ubuntu.
6:48:00 PM: Missing required packages: libssl1.0-dev
6:48:00 PM: RVM autolibs is now configured with mode '2' =>
6:48:00 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
6:48:00 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
6:48:00 PM: or visit https://rvm.io/rvm/autolibs for more information.
6:48:00 PM: Found undesired packages: libssl-dev
6:48:00 PM: RVM autolibs is now configured with mode '2' =>
6:48:00 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
6:48:00 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
6:48:00 PM: or visit https://rvm.io/rvm/autolibs for more information.
6:48:00 PM: Requirements installation failed with status: 1.
6:48:00 PM: ruby-2.3.6 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.3.6
6:48:00 PM: Required ruby-2.3.6 is not installed - installing.
6:48:01 PM: Searching for binary rubies, this might take some time.
6:48:01 PM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-2.3.6.tar.bz2
6:48:01 PM: Checking requirements for ubuntu.
6:48:01 PM: Missing required packages: libssl1.0-dev
6:48:01 PM: RVM autolibs is now configured with mode '2' =>
6:48:01 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
6:48:01 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
6:48:01 PM: or visit https://rvm.io/rvm/autolibs for more information.
6:48:01 PM: Found undesired packages: libssl-dev
6:48:01 PM: RVM autolibs is now configured with mode '2' =>
6:48:01 PM:   'Allow RVM to use package manager if found, fail if dependencies are missing. This is default.',
6:48:01 PM: please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
6:48:01 PM: or visit https://rvm.io/rvm/autolibs for more information.
6:48:01 PM: Requirements installation failed with status: 1.
6:48:02 PM: ruby-2.3.6 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
6:48:02 PM: ruby-2.3.6 - #generating default wrappers.................
6:48:02 PM: Error running 'run_gem_wrappers regenerate',
6:48:02 PM: please read /opt/buildhome/.rvm/log/1630460882_ruby-2.3.6/gemset.wrappers.default.log
6:48:02 PM: Using /opt/buildhome/.rvm/gems/ruby-2.3.6
6:48:02 PM: Warning! Executable 'ruby' missing, something went wrong with this ruby installation!
6:48:02 PM: Warning! Executable 'gem' missing, something went wrong with this ruby installation!
6:48:02 PM: Warning! Executable 'irb' missing, something went wrong with this ruby installation!
6:48:02 PM: Using ruby version 2.3.6
6:48:02 PM: /opt/buildhome/.rvm/scripts/override_gem: line 19: gem: command not found
6:48:02 PM: Error installing bundler
6:48:02 PM: Build was terminated: Build script returned non-zero exit code: 1
6:48:02 PM: Creating deploy upload records
6:48:02 PM: Failing build: Failed to build site
6:48:02 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
6:48:02 PM: Finished processing build request in 9.011694746s

Hi @segdeha,

Could you try setting RUBY_VERSION environment variable to 2.7.2?

OK, did that and the site built, but with a whole bunch of warnings. Would the plan be to upgrade the version of Ruby in the image so I could eventually remove the env var? Thanks for your response!

Output:

7:58:27 AM: Build ready to start
7:58:29 AM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
7:58:29 AM: build-image tag: v4.3.0
7:58:29 AM: buildbot version: fd60e21d56897195475b3dbb3e1c495894eb873c
7:58:29 AM: Building without cache
7:58:29 AM: Starting to prepare the repo for build
7:58:29 AM: No cached dependencies found. Cloning fresh repo
7:58:29 AM: git clone https://github.com/segdeha/playground
7:58:30 AM: Preparing Git Reference refs/heads/master
7:58:30 AM: Parsing package.json dependencies
7:58:31 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'build' versus './build' in the Netlify UI
7:58:31 AM: Starting build script
7:58:31 AM: Installing dependencies
7:58:31 AM: Python version set to 2.7
7:58:32 AM: Downloading and installing node v8.17.0...
7:58:32 AM: Downloading https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz...
7:58:32 AM: Computing checksum with sha256sum
7:58:32 AM: Checksums matched!
7:58:34 AM: Now using node v8.17.0 (npm v6.13.4)
7:58:34 AM: Started restoring cached build plugins
7:58:34 AM: Finished restoring cached build plugins
7:58:35 AM: Attempting ruby version 2.7.2, read from environment
7:58:36 AM: Using ruby version 2.7.2
7:58:37 AM: Using PHP version 8.0
7:58:37 AM: Started restoring cached node modules
7:58:37 AM: Finished restoring cached node modules
7:58:37 AM: Installing NPM modules using NPM version 6.13.4
7:58:39 AM: npm WARN deprecated babel-eslint@7.2.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
7:58:40 AM: npm WARN deprecated eslint-loader@1.9.0: This loader has been deprecated. Please use eslint-webpack-plugin
7:58:40 AM: npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
7:58:40 AM: npm WARN deprecated html-webpack-plugin@2.29.0: out of support
7:58:40 AM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
7:58:41 AM: npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
7:58:41 AM: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
7:58:44 AM: npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
7:58:44 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
7:58:44 AM: npm WARN deprecated sw-precache@5.2.1: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
7:58:45 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
7:58:50 AM: npm WARN deprecated sw-toolbox@3.6.0: Please migrate to Workbox: https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
7:58:50 AM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
7:58:51 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
7:58:51 AM: npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
7:58:51 AM: npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
7:58:52 AM: npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
7:58:52 AM: npm WARN deprecated sane@1.6.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
7:58:53 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
7:58:55 AM: npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
7:58:57 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
7:58:57 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
7:59:25 AM: > node-sass@4.14.1 install /opt/build/repo/node_modules/node-sass
7:59:25 AM: > node scripts/install.js
7:59:26 AM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-57_binding.node
7:59:26 AM: Download complete
7:59:26 AM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-57/binding.node
7:59:26 AM: Caching binary to /opt/buildhome/.npm/node-sass/4.14.1/linux-x64-57_binding.node
7:59:26 AM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/core-js
7:59:26 AM: > node -e "try{require('./postinstall')}catch(e){}"
7:59:27 AM: > uglifyjs-webpack-plugin@0.4.6 postinstall /opt/build/repo/node_modules/uglifyjs-webpack-plugin
7:59:27 AM: > node lib/post_install.js
7:59:27 AM: > node-sass@4.14.1 postinstall /opt/build/repo/node_modules/node-sass
7:59:27 AM: > node scripts/build.js
7:59:27 AM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-57/binding.node
7:59:27 AM: Testing binary
7:59:27 AM: Binary is fine
7:59:27 AM: > styled-components@3.4.10 postinstall /opt/build/repo/node_modules/styled-components
7:59:27 AM: > node ./scripts/postinstall.js || exit 0
7:59:27 AM: Use styled-components at work? Consider supporting our development efforts at opencollective.com/styled-components
7:59:30 AM: npm notice created a lockfile as package-lock.json. You should commit this file.
7:59:30 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
7:59:30 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:59:30 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.3 (node_modules/react-scripts/node_modules/fsevents):
7:59:30 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:59:30 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
7:59:30 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:59:30 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
7:59:30 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
7:59:30 AM: added 1547 packages from 896 contributors and audited 1551 packages in 51.847s
7:59:31 AM: 47 packages are looking for funding
7:59:31 AM:   run `npm fund` for details
7:59:31 AM: found 87 vulnerabilities (35 low, 35 moderate, 17 high)
7:59:31 AM:   run `npm audit fix` to fix them, or `npm audit` for details
7:59:31 AM: NPM modules installed
7:59:31 AM: Started restoring cached go cache
7:59:31 AM: Finished restoring cached go cache
7:59:31 AM: Installing Go version 1.10
7:59:36 AM: unset GOOS;
7:59:36 AM: unset GOARCH;
7:59:36 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
7:59:36 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
7:59:36 AM: go version >&2;
7:59:36 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env"
7:59:36 AM: go version go1.10 linux/amd64
7:59:36 AM: Installing missing commands
7:59:36 AM: Verify run directory
7:59:37 AM: ​
7:59:37 AM: ────────────────────────────────────────────────────────────────
7:59:37 AM:   Netlify Build                                                 
7:59:37 AM: ────────────────────────────────────────────────────────────────
7:59:37 AM: ​
7:59:37 AM: ❯ Version
7:59:37 AM:   @netlify/build 18.7.2
7:59:37 AM: ​
7:59:37 AM: ❯ Flags
7:59:37 AM:   baseRelDir: false
7:59:37 AM:   buildId: 612f951359dd360ae4a07743
7:59:37 AM:   deployId: 612f951359dd360ae4a07745
7:59:37 AM: ​
7:59:37 AM: ❯ Current directory
7:59:37 AM:   /opt/build/repo
7:59:37 AM: ​
7:59:37 AM: ❯ Config file
7:59:37 AM:   No config file was defined: using default values.
7:59:37 AM: ​
7:59:37 AM: ❯ Context
7:59:37 AM:   production
7:59:37 AM: ​
7:59:37 AM: ────────────────────────────────────────────────────────────────
7:59:37 AM:   1. Build command from Netlify app                             
7:59:37 AM: ────────────────────────────────────────────────────────────────
7:59:37 AM: ​
7:59:37 AM: $ npm run build
7:59:37 AM: > playground@0.1.0 build /opt/build/repo
7:59:37 AM: > npm-run-all build-css build-js
7:59:38 AM: > playground@0.1.0 build-css /opt/build/repo
7:59:38 AM: > node-sass-chokidar src/ -o src/
7:59:38 AM: Rendering Complete, saving .css file...
7:59:38 AM: Wrote CSS to /opt/build/repo/src/App.css
7:59:38 AM: Wrote 1 CSS files to /opt/build/repo/src/
7:59:38 AM: > playground@0.1.0 build-js /opt/build/repo
7:59:38 AM: > react-scripts build
7:59:40 AM: Creating an optimized production build...
7:59:47 AM: Compiled successfully.
7:59:47 AM: 
7:59:47 AM: File sizes after gzip:
7:59:47 AM:   77.35 KB  build/static/js/main.abc1aa86.js
7:59:47 AM:   256 B     build/static/css/main.cd9ede75.css
7:59:47 AM: The project was built assuming it is hosted at the server root.
7:59:47 AM: You can control this with the homepage field in your package.json.
7:59:47 AM: For example, add this to build it for GitHub Pages:
7:59:47 AM:   "homepage" : "http://myname.github.io/myapp",
7:59:47 AM: The build folder is ready to be deployed.
7:59:47 AM: You may serve it with a static server:
7:59:47 AM:   npm install -g serve
7:59:47 AM:   serve -s build
7:59:47 AM: Find out more about deployment here:
7:59:47 AM:   http://bit.ly/2vY88Kr
7:59:48 AM: ​
7:59:48 AM: (build.command completed in 10.8s)
7:59:48 AM: ​
7:59:48 AM: ────────────────────────────────────────────────────────────────
7:59:48 AM:   2. Deploy site                                                
7:59:48 AM: ────────────────────────────────────────────────────────────────
7:59:48 AM: ​
7:59:48 AM: Starting to deploy site from 'build'
7:59:48 AM: Creating deploy tree 
7:59:48 AM: Creating deploy upload records
7:59:48 AM: 5 new files to upload
7:59:48 AM: 0 new functions to upload
7:59:48 AM: Site deploy was successfully initiated
7:59:48 AM: ​
7:59:48 AM: (Deploy site completed in 348ms)
7:59:48 AM: ​
7:59:48 AM: ────────────────────────────────────────────────────────────────
7:59:48 AM:   Netlify Build Complete                                        
7:59:48 AM: ────────────────────────────────────────────────────────────────
7:59:48 AM: ​
7:59:48 AM: (Netlify Build completed in 11.1s)
7:59:48 AM: Starting post processing
7:59:48 AM: Post processing - HTML
7:59:49 AM: Caching artifacts
7:59:49 AM: Started saving node modules
7:59:49 AM: Finished saving node modules
7:59:49 AM: Started saving build plugins
7:59:49 AM: Finished saving build plugins
7:59:49 AM: Started saving pip cache
7:59:49 AM: Finished saving pip cache
7:59:49 AM: Post processing - header rules
7:59:49 AM: Started saving emacs cask dependencies
7:59:49 AM: Finished saving emacs cask dependencies
7:59:49 AM: Started saving maven dependencies
7:59:49 AM: Finished saving maven dependencies
7:59:49 AM: Started saving boot dependencies
7:59:49 AM: Finished saving boot dependencies
7:59:49 AM: Started saving rust rustup cache
7:59:49 AM: Finished saving rust rustup cache
7:59:49 AM: Started saving go dependencies
7:59:49 AM: Post processing - redirect rules
7:59:49 AM: Post processing done
7:59:49 AM: Site is live ✨
7:59:50 AM: Finished saving go dependencies
7:59:53 AM: Build script success

The problem is actually that the default Ruby version in that image is 2.7.2, though for some users who upgraded, it was still pulling 2.3.6.

1 Like

I have the same problem. Changed the build image due to the Netlify email. It complains about missing Ruby, but I’m not even using Ruby. I use Hugo which worked fine witht he old build image.

@lgr, have you tried what’s suggested above?

Yes it does work. But I was surprised to have extra work just for upgrading build images. I‘m not using Ruby at all.

If you wish to know, there’s a detailed explanation behind this here: