Going in circles with jekyll-sitemap

The Problem
I’ve spent about an hour trying to get jekyll-sitemap to work.

The Error Message
Dependency Error: Yikes! It looks like you don’t have jekyll-sitemap or one of its dependencies installed. In order to use Jekyll as currently configured, you’ll need to install this gem. If you’ve run Jekyll with bundle exec, ensure that you have included the jekyll-sitemap gem in your Gemfile as well. The full error message from Ruby is: ‘cannot load such file – jekyll-sitemap’ If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
Jekyll 4.2.0 Please append --trace to the serve command
for any additional information or backtrace.

What I tried
1. I’ve read through other people’s posts, but I haven’t found a way to solve this problem. At one point, I had to go through and uncomment plug-ins in my _config.yml file one by one and I was suprised to see that the following plugins produced a similar error (the amount of them. This is before I nuked my project and made a new one.)
2. Followed instructions to install, alter Gemfile, and alter _config.yml
3. Nuked the project, made a new one, and tried again.

Problem Plugins
jekyll-sitemap, jekyll-compose, jekyll-paginate-v2, jekyll-archives, amp-jekyll, jekyll-remote-theme, jekyll-mentions, jekyll-analytics, jekyll-spaceship, jekyll-target-blank, jetpack, jekyll-auto-image


  1. Could it be something outside the jekyll environment? (This is the first time I’ve experienced mass plugin rejection.)
  2. How can I fix this problem with jekyll-sitemap?

For comparison, here is a quick test I ran:

Version checks:

$ ruby -v ; jekyll -v
ruby 2.7.2 [...]
jekyll 4.2.0

Script run:

jekyll new maptest
cd maptest/
bundle add jekyll-sitemap
printf "\nplugins:\n  - jekyll-sitemap\n" >> _config.yml 
bundle exec jekyll build
cat _site/sitemap.xml 

Result: Sitemap XML is printed by cat command.

1 Like

You say that you have tried altering your Gemfile. But you did not mention anything about running bundle install in a subsequent step.
So, please post the output from running:

  • bundle list
  • bundle info jekyll-sitemap
  • bundle exec jekyll build --trace
1 Like