Deploy Existing Jekyll Site to Netlify

I keep getting the error when trying to deploy my site. I have reviewed the existing issues

I tried updating my bundler version and removing Bundled with from my Gemlock file.

3:31:05 PM: Bundler could not find compatible versions for gem "bundler":
3:31:05 PM:   In Gemfile:
3:31:05 PM:     bundler (~> 2.1.4)
3:31:05 PM:   Current Bundler version:
3:31:05 PM:     bundler (2.2.8)
3:31:05 PM: Your bundle requires a different version of Bundler than the one you're running.

Site - stoic-lichterman-48da40

Full Log

3:30:40 PM: Build ready to start
3:30:42 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
3:30:42 PM: build-image tag: v3.6.1
3:30:42 PM: buildbot version: a0f5a242397f47e25a65cd8b1de9758023166a1b
3:30:42 PM: Fetching cached dependencies
3:30:42 PM: Failed to fetch cache, continuing with build
3:30:42 PM: Starting to prepare the repo for build
3:30:42 PM: No cached dependencies found. Cloning fresh repo
3:30:42 PM: git clone
3:30:44 PM: Preparing Git Reference refs/heads/master
3:30:45 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: '_site' versus '_site/' in the Netlify UI
3:30:45 PM: Starting build script
3:30:45 PM: Installing dependencies
3:30:45 PM: Python version set to 2.7
3:30:47 PM: v12.18.0 is already installed.
3:30:47 PM: Now using node v12.18.0 (npm v6.14.4)
3:30:47 PM: Started restoring cached build plugins
3:30:47 PM: Finished restoring cached build plugins
3:30:48 PM: Required ruby-2.4.3 is not installed.
3:30:48 PM: To install do: 'rvm install "ruby-2.4.3"'
3:30:48 PM: Attempting ruby version 2.4.3, read from .ruby-version file
3:30:48 PM: 
3:30:48 PM: ** WARNING **
3:30:48 PM: Using custom ruby version 2.4.3, this will slow down the build.
3:30:48 PM: To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
3:30:48 PM: Included versions: 2.7.1 2.6.2
3:30:48 PM: 
3:30:49 PM: Required ruby-2.4.3 is not installed - installing.
3:30:49 PM: Searching for binary rubies, this might take some time.
3:30:49 PM: Found remote file
3:30:49 PM: Checking requirements for ubuntu.
3:30:50 PM: Requirements installation successful.
3:30:50 PM: ruby-2.4.3 - #configure
3:30:50 PM: ruby-2.4.3 - #download
3:30:51 PM: ruby-2.4.3 - #validate archive
3:30:55 PM: ruby-2.4.3 - #extract
3:30:58 PM: ruby-2.4.3 - #validate binary
3:30:58 PM: ruby-2.4.3 - #setup
3:30:59 PM: ruby-2.4.3 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.4.3@global
3:31:01 PM: ruby-2.4.3 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems............................................................
3:31:01 PM: ruby-2.4.3 - #generating global wrappers.......
3:31:01 PM: ruby-2.4.3 - #gemset created /opt/buildhome/.rvm/gems/ruby-2.4.3
3:31:01 PM: ruby-2.4.3 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
3:31:01 PM: ruby-2.4.3 - #generating default wrappers.......
3:31:01 PM: Using /opt/buildhome/.rvm/gems/ruby-2.4.3
3:31:02 PM: Using ruby version 2.4.3
3:31:02 PM: Using PHP version 5.6
3:31:02 PM: Started restoring cached ruby gems
3:31:02 PM: Finished restoring cached ruby gems
3:31:02 PM: Installing gem bundle
3:31:02 PM: [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/opt/build/cache/bundle'`, and stop using this flag
3:31:02 PM: [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all`
3:31:05 PM: Fetching gem metadata from
3:31:05 PM: Resolving dependencies...
3:31:05 PM: Bundler could not find compatible versions for gem "bundler":
3:31:05 PM:   In Gemfile:
3:31:05 PM:     bundler (~> 2.1.4)
3:31:05 PM:   Current Bundler version:
3:31:05 PM:     bundler (2.2.8)
3:31:05 PM: Your bundle requires a different version of Bundler than the one you're running.Install the necessary version with `gem install bundler:2.1.4` and rerun bundler
3:31:05 PM: using `bundle _2.1.4_ install --path /opt/build/cache/bundle--binstubs=/opt/build/cache/binstubs`
3:31:05 PM: Error during gem install
3:31:05 PM: Build was terminated: Build script returned non-zero exit code: 1
3:31:05 PM: Failing build: Failed to build site
3:31:05 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
3:31:05 PM: Finished processing build request in 23.791566426s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

I did try to search the forum for my answer see in the original request the closest issues I could find.

The issue seems to be that Netlify wants to use it’s own version of bundler instead of the one I specified.

Here is my Gemlock File

  bundler (~> 2.1.4)
  "name": "just-the-docs",
  "version": "0.3.1",
  "description": "A modern Jekyll theme for documentation",
  "repository": "pmarsceill/just-the-docs",
  "license": "MIT",
  "bugs": "",
  "devDependencies": {
    "@primer/css": "^15.1.0",
    "prettier": "^2.0.5",
    "stylelint": "^13.6.1",
    "stylelint-config-prettier": "^8.0.2",
    "stylelint-config-primer": "^9.0.0",
    "stylelint-prettier": "^1.1.2",
    "stylelint-selector-no-utility": "^4.0.0"
  "scripts": {
    "test": "stylelint '**/*.scss'",
    "format": "prettier --write '**/*.{scss,js,json}'",
    "stylelint-check": "stylelint-config-prettier-check",
    "build": "jekyll build && mv _site public"
  "dependencies": {}

Hi, @tjperry07. I don’t have a way to downgrade the Bundler version used at this time.

Is it possible to change the bundler line in Gemlock to:

  bundler (>=  2.1.4)

I don’t know your codebase so I don’t know if that is a breaking change or not. If it isn’t a breaking change, it should resolve the issue.

​Please let us know if there are other questions or more we can do to assist.

Hi @tjperry07. There are a couple of things going on here. The first is that you are specifying bundler in your Gemfile, which is unusual. Bundler is meant to be installed globally, not as a gem within a project. Is your Jekyll project perhaps based on a clone or fork of a gem-based Jekyll theme that includes a .gemspec file with a line that looks like this?

spec.add_development_dependency "bundler", "~> 2.1.4"

And does your Gemfile refer to that .gemspec file with a line like this:


If so, then you’ll need to remove that gemspec line from your Gemfile, and instead, add all the gems listed in the .gemspec file next to spec.add_runtime_dependency only, not the development dependencies.

Then, you’ll want to update your Gemfile to use the latest version of Bundler:

  1. Update bundler: gem update bundler. As of today, the latest version is 2.2.10
  2. Update the Gemfile: bundle update --bundler
    You should now see this at the very bottom of your Gemfile.lock:

Now run bundle exec jekyll serve and make sure everything still works locally. If it does, commit the changes, then push to GitHub, and let’s see if that resolves the Netlify issue.

The other issue I was going to mention is that you are using a super old version of Ruby. I would recommend updating your .ruby-version file to say ruby-2.7.1, which is the latest version installed on Netlify, and will make the builds faster. For that to work locally, you’ll need a Ruby version manager that allows you to install multiple versions of Ruby. Presumably, you already have one if you’re using Ruby 2.4.3, but if not, I recommend chruby.

Here are some guides I’ve written that might help you learn more about Ruby, which is important if you’re working with Jekyll:

I’m also planning on writing a new guide about deploying Jekyll to Netlify to explain common issues I see people struggle with over and over, so that you can feel confident troubleshooting these types of issues in the future.

I have the same problem and no workaround found… very strange