My Netlify site is quiet-custard-3a5bea. I just upgraded from Ruby 2.7.2 to 3.1.2, and now my deploys aren’t working because the ruby binary isn’t being found.
The build log is:
1:53:18 PM: Build ready to start
1:53:19 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
1:53:19 PM: build-image tag: v4.8.0
1:53:19 PM: buildbot version: 5271e9715084f43bb9084ec0da517d4a5a908ada
1:53:20 PM: Fetching cached dependencies
1:53:20 PM: Starting to download cache of 394.5MB
1:53:24 PM: Finished downloading cache in 4.499486575s
1:53:24 PM: Starting to extract cache
1:53:32 PM: Finished extracting cache in 7.778835692s
1:53:32 PM: Finished fetching cache in 12.331198536s
1:53:32 PM: Starting to prepare the repo for build
1:53:32 PM: Preparing Git Reference refs/heads/main
1:53:35 PM: Parsing package.json dependencies
1:53:37 PM: Starting build script
1:53:37 PM: Installing dependencies
1:53:37 PM: Python version set to 2.7
1:53:37 PM: Started restoring cached node version
1:53:38 PM: Finished restoring cached node version
1:53:39 PM: v16.15.0 is already installed.
1:53:40 PM: Now using node v16.15.0 (npm v8.5.5)
1:53:40 PM: Started restoring cached build plugins
1:53:40 PM: Finished restoring cached build plugins
1:53:40 PM: Required ruby-3.1.2 is not installed.
1:53:40 PM: To install do: 'rvm install "ruby-3.1.2"'
1:53:40 PM: Attempting ruby version 3.1.2, read from .ruby-version file
1:53:40 PM: Started restoring cached ruby version
1:53:41 PM: Finished restoring cached ruby version
1:53:43 PM: Using ruby version 3.1.2
1:53:43 PM: Using bundler version 2.1.4 from Gemfile.lock
1:53:44 PM: Successfully installed bundler-2.1.4
1:53:44 PM: 1 gem installed
1:53:44 PM: Using PHP version 8.0
1:53:44 PM: Started restoring cached ruby gems
1:53:44 PM: Finished restoring cached ruby gems
1:53:44 PM: Creating deploy upload records
1:53:44 PM: Installing gem bundle
1:53:44 PM: /opt/buildhome/.rvm/gems/ruby-3.1.2/bin/bundle: 6: exec: /opt/buildhome/.rvm/gems/ruby-3.1.2/bin/ruby: not found
1:53:44 PM: Error during gem install
1:53:44 PM: Build was terminated: Build script returned non-zero exit code: 1
1:53:44 PM: Failing build: Failed to build site
1:53:45 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
1:53:45 PM: Finished processing build request in 25.277257658s
For what it’s worth, if I hit “clear cache and retry deploy”, it works correctly, so it seems it’s related to caching somehow (unfortunately this makes deploys take longer and it’s eating into my build minutes, so it’s not a tenable long-term solution).
hi again, thanks for that info. We can absolutely forgive you some build minutes if you’d like to keep troubleshooting. let me know.
if it were related to caching, the error shouldn’t appear on a brand new site - would you mind trying either of your broken configs on a brand new site and see if those work?
Thank you for that! I have filed a bug for this with the appropriate team and we will get it looked at. Until we can fix it, is 3.1.1 working for you so far?
We’ll let you know once you can try upgrading to 3.1.2 here.
Ruby 3.1.2 worked for my site until yesterday, May 11, when my daily builds started failing with this exact error message. It works if I build while clearing cache, but fails if I build without clearing cache.
Unfortunately, for me even Ubuntu 20.04 only works the first time with Ruby 3.1.2, and building the same commit again without clearing the cache fails.
I have shared this update directly with the team working on this. Thanks for your patience! A member of the Support Team will follow up here when we have more information.
we’re so sorry to hear you are encountering this issue. A team member from is taking a look at this problem this week and we will keep you updated as we try and work on a solution.
We’ve narrowed down the issue and it seems to be a caching issue.
can you all try and clear & cache and redeploy and see if that fixes things?
it’s not a permanent fix, i understand, but at least this might get your sites deployed, so if you could try and see if this does/doesn’t work that would be helpful.
Please see the text of my post from 26 days ago, explicitly stating that this was a cache issue, and noting that deploys only when I manually log in and choose to clear cache is the entire problem I am reporting. Thanks.
hi there, thanks for your patience - we are still discussing this internally and hoping to speak with a team who can hopefully provide more insight soon, and we’ll get back to you when we can. We haven’t forgotten.
After further investigation, the problem appears to be with the non-default bundler version being used. Could you try using bundler version 2.3.7 in your Gemfile.lock file?
As to how this can be fixed, it’s still being looked into, but hopefully this solves it in the meantime?