Having an issue with bundler for hosting on macOS 10.15

This project requires bundler 1.15, I installed bundler 1.15 and bundler -v outputs

Bundler version 1.15.0
The latest bundler is 2.2.0.rc.2, but you are currently running 1.15.0.
To update, run gem install bundler --pre

Then I get this error when I run “bundle exec jekyll serve”

Could not find gem ‘jekyll-redirect-from’ in any of the gem sources listed in your Gemfile.

Run bundle install to install missing gems.

I run "bundle install and I get this

Fetching gem metadata from https://rubygems.org/
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies…
Bundler could not find compatible versions for gem “bundler”:
In Gemfile:
bundler (~> 1.15)

Current Bundler version:
bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?

Could not find gem ‘bundler (~> 1.15)’ in any of the relevant sources:
the local ruby installation

Even when I have bundler 1.15. Any solutions? Thanks in advance.

In somewhat similar situation I was able to solve it by deleting the version requirements in my _config.yml file.

Did that and still the same error after when I ran “bundle install”

One hack if you control the repo is to delete the bundle version at the end of Gemfile.lock that worked for me. It looks like it says 2.1.4

But I also found out that requiring a certain version of Bundler based on the lock file.

If you try to use Bundler 2 on an application that needs Bundler 1, and you also don’t have Bundler 1 installed at all,

If you upgrade to a newer version of bundler then this is solved. That means that bundler 2.x installed will work with a project that has 1.X or 2.X in the lock file.

gem install bundler -v "~>2"


gem update bundler 

I’d also recommend always using the --user-install flag when installing and updating gems for your user. Otherwise you have to use sudo and so end up installing gems for root user and not for your user at ~/.gems or similar

I suppose its something with my ruby install because of the “Could not find gem ‘bundler (~> 1.15)’ in any of the relevant sources:
the local ruby installation” error?

Oh I misunderstood the first message.

It is weird to list Bundler in a Gemfile.
I’d say take that line out if the Gemfile.
And ideally make sure you have bundler 2.x installed at the user level.

Your Gemfile.lock file will say installed with Bundler x.x but you won’t be affected on the latest bundler.

Check these are all available

gem -v
bundler -v

If the 2nd doesn’t work then run the install command I gave plus also edit your PATH in .zshrc or .bashrc to make sure you can run bundler from your user gems from anywhere

I wrote detailed steps here

Delete any mention of bundle in your Gemfiles. And then bundle install

Share a link to your repo. I’d like to see the Gemfile and Gemfile.lock

It looks like you have jekyll-redirect-from in your config but it’s not installed.

Make sure this is in Gemfile

gem 'jekyll-redirect-from'

Then bundle install and then serve

Also make sure you configure bundler as per my instructions so gems go to vendor dir inside the repo