Could not find public_suffix-3.0.2 in any of the sources

When I try to run jekyll after installation on my iMac, I get the following error:

/Users/coolguy123/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/spec_set.rb:91:in 'block in materialize': Could not find public_suffix-3.0.2 in any of the sources (Bundler::GemNotFound)

I checked my gem list and found that public_suffix is installed but it is version 3.1.1. I installed version 3.0.2 and that error went away but then it complains about missing the “addressable” gem, which again is installed but apparently not the older version that jekyll is looking for. After doing this process for about 5 additional gems, I gave up.

I’ve successfully used jekyll in the past so I’m not sure what is wrong now. I’ve tried reinstalling ruby, first through homebrew, then through rbenv but both end up with the same problem.

Any help you could provide would be greatly appreciated.

Update rbenv, install the latest ruby version globally. Then update your gems. Try updating bundler if needed. And don’t forget to install the Jekyll gem as well.

Thanks for the response.

I updated rbenv, installed (and switched to) the latest ruby version (2.6.3), and updated my gems. Unfortunately, I still get the same error.

Have you updated to Mojave ? If you did then you most likely have messed up the bundler paths. See if this can help you out: https://stackoverflow.com/questions/23801899/bundlergemnotfound-could-not-find-rake-10-3-2-in-any-of-the-sources

I was running into the same issue on both my newer Mac (which always had Mojave installed) and my older Mac (still running High Sierra). While the linked to StackOverflow question didn’t solve the problem by itself, after running that bundle command, I got a new error message that suggested I run “bundle exec” before the command (i.e. “bundle exec jekyll build”) and that worked.

That ultimately led me to look at my Gemlock file and see it specified an older version of Jekyll (3.8.3). After updating the Gemfile to use my newest (installed) version, it works with just “jekyll build” (i.e. no bundle exec prefix).

Thanks for the help