Having trouble with jekyll-sitemap


Hello all,

I’m building a site I’m planning on hosting at github.io with Jekyll, and I’m trying to get jekyll-sitemap going.

I’m running into an issue where it’s broken because I’m on Jekyll 3.4.0 but it seems jekyll-sitemap is requiring Jekyll 3.3.1.

The error output (as well as chatter that I can find on stack overflow) says to try bundle exec, however my understanding is that this simply forces versions being required and I’d like to avoid downgrading Jekyll for the obvious reasons.

Wonder if any of you folks ever run into this, and if so did you solve the issue without downgrading Jekyll? Or perhaps I’m misunderstanding something here and you can better inform me? :slight_smile:

Thanks guys… and below is the stack trace when trying to run jekyll build

⇒  jekyll build              
WARN: Unresolved specs during Gem::Specification.reset:
      listen (< 3.1, ~> 3.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.4/lib/bundler/runtime.rb:40:in `block in setup': You have already activated jekyll 3.4.0, but your Gemfile requires jekyll 3.3.1. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
	from /Library/Ruby/Gems/2.0.0/gems/bundler-1.14.4/lib/bundler/runtime.rb:25:in `map'
	from /Library/Ruby/Gems/2.0.0/gems/bundler-1.14.4/lib/bundler/runtime.rb:25:in `setup'
	from /Library/Ruby/Gems/2.0.0/gems/bundler-1.14.4/lib/bundler.rb:100:in `setup'
	from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
	from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/exe/jekyll:9:in `<top (required)>'
	from /usr/bin/jekyll:22:in `load'
	from /usr/bin/jekyll:22:in `<main>'


Removing jekyll-sitemap from the Gemfile results in the same error, I discovered, so the issue must be with github-pages. Here’s the new Gemfile for reference:

source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins


Could You show us Your Gemfile?


Yes, sorry I should have included that.

source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll-sitemap" 

Thanks Gynter.


…then in _config.yml

markdown: kramdown
  - package.json
  - node_modules
  - gulpfile.js
  - bower.json
  - README.md
  - jekyll-sitemap


Actually, and now that I’ve gotten that for you, I realize that removing jekyll-sitemap still results in the same error, so the problem must be in github-pages.


Ah, now I see. github-pages gem depends on Jekyll version 3.3.1 therefore You can’t use Jekyll 3.4.0 with github-pages gem. Check the runtime dependencies from the link I just posted. It shows the dependencies which github-pages will install/require.


Thank you Gynter, that explains it, I guess I’m out of luck if I want to stay on Jekyll 3.4. Appreciate the help.


If You want to use Jekyll 3.4.0 with github then You must build the web locally and commit the built page to master branch along with file .nojekyll. See my repo for this kind of solution. There’s two branches source and master. Latter one contains the locally built and commited to repo data.


Ah, I see. That really nullifies a lot of the benefit of using github pages, so I should definitely consider redoing this on Jekyll 3.3.1. I am building this site with the intention of less-technical users being able to easily maintain the content with the markdown files, and was imagining a situation where they didn’t necessarily have to get the whole environment running.

Thanks for the excellent advice, I appreciate the link to your repo example.