Builds: Bundler version from Gemfile.lock now installed and used

The Bundler version specified in the BUNDLED_WITH section of your Gemfile.lock file is now automatically installed and used to install the gems from your Gemfile. If you’ve been previously advised to change your Gemfile.lock to specify an older version of Bundler such as 2.0.1, that workaround is no longer necessary. See also https://github.com/netlify/build-image/issues/296.

4 Likes

If your site is set to use a Ruby version older than 2.3.0 and you have no Gemfile.lock (or your Gemfile.lock specifies a version of bundler that is 2.0.0 or greater), you may encounter a build failure with the message “bundler requires Ruby version >= 2.3.0”. While we plan to fix this, you can get it working right now with one of two methods:

  1. Make your build use a newer Ruby version by setting the RUBY_VERSION environment variable in the Netlify UI to 2.3.0 or any newer version.
  2. Add a Gemfile.lock created by a bundler version that is older than 2.0.0. To specify the version of bundler to run, install the desired bundler version then run bundle with the version surrounded by underscores as the first argument. For instance, to create a Gemfile.lock using bundler version 1.17.3, run gem install bundler:1.17.3 then run bundle _1.17.3_ lock.

See also https://github.com/netlify/build-image/issues/356.

1 Like

I think I have a related issue, perhaps you can help. So my middleman site requires Ruby 2.6.4 and is using bundler 1.17.3. I have used an ENV on netlify to specify RVM install ruby 2.6.4 (as opposed to 2.3.0 which i think is the netlify default?). However when i go to build the site I get following output in deploy log. I have truncated just showing the relevant bit not all the stuff at the start:

10:35:21 AM: Using /opt/buildhome/.rvm/gems/ruby-2.6.4

10:35:22 AM: Using ruby version 2.6.4
10:35:22 AM: Using bundler version 1.17.3 from Gemfile.lock
10:35:22 AM: Using PHP version 5.6
10:35:22 AM: Started restoring cached ruby gems
10:35:22 AM: Finished restoring cached ruby gems
10:35:22 AM: Installing gem bundle
10:35:22 AM: Could not find command “1.17.3”.
10:35:22 AM: Error during gem install
10:35:22 AM: Error running command: Build script returned non-zero exit code: 1
10:35:22 AM: failed during stage ‘building site’: Build script returned non-zero exit code: 1
10:35:22 AM: Failing build: Failed to build site

Can you help?
Dave

hi dave, can you pull this post out of this thread and put it in its own thread in the #Netlify-support category?

it’ll get lost here.

we’ll need a bit more context - does this work locally, what is your netlify user name, what have you tried, etc. :+1:

Perry, I have already done that but then came across this ‘similar’ issue and thought it was worth posting in this thread!. Other thread is RVM Install ruby 2.6.4 failed
It works locally, netlify user is daveharrisonnet. Also from the output I posted above I notice it has stripped out underscores either side of the 1.17.3 Could not find “[underscore]1.17.3{underscore]”

hi @DaveHarrison, we’ll respond on the other thread to keep this category update-specific. thanks!