Bundler compatible versions for gem "jekyll"
Asked Answered
G

3

6

I'm trying to setup github page using Jekyll, currently it is using minima theme, and I want to change it to jekyll-theme-hacker.

So, I went to Gemfile, I added

gem "github-pages", group:jekyll_plugins

under the

gem "minima", "~>2.5"

And after saving it, I did

bundle install

But this gives me the error.

Bundler could not find compatible versions for gem "jekyll":
  In snapshot (Gemfile.lock):
    jekyll (= 4.0.0)

  In Gemfile:
    jekyll (~> 4.0.0)

    jekyll-theme-hacker was resolved to 0.0.4, which depends on
      jekyll (~> 3.3)

Running `bundle update` will rebuild your snapshot from scratch, using
only
the gems in your Gemfile, which may resolve the conflict.

I am very new to the Jekyll and Programming, I wonder why this happened.

As far as what I could figure out was, Bundler is a Gem management tool, which Gem stands for the library or module for ruby programming langauge. So what I was trying to do was trying to install all the necessary things for the my new theme.

However bundler could not find compatible versions for gem "jekyll". What does this exactly mean? Do I need a different dependency of jekyll to use my new theme? If it is so, How can I do it?

Thanks a lot in advance.

----EDIT---- This is how my Gemfile.lock looks like

GEM
  remote: https://rubygems.org/
  specs:
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    colorator (1.1.0)
    concurrent-ruby (1.1.5)
    em-websocket (0.5.1)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.6.0)
    eventmachine (1.2.7)
    ffi (1.11.1)
    forwardable-extended (2.6.0)
    http_parser.rb (0.6.0)
    i18n (1.7.0)
      concurrent-ruby (~> 1.0)
    jekyll (4.0.0)
      addressable (~> 2.4)
      colorator (~> 1.0)
      em-websocket (~> 0.5)
      i18n (>= 0.9.5, < 2)
      jekyll-sass-converter (~> 2.0)
      jekyll-watch (~> 2.0)
      kramdown (~> 2.1)
      kramdown-parser-gfm (~> 1.0)
      liquid (~> 4.0)
      mercenary (~> 0.3.3)
      pathutil (~> 0.9)
      rouge (~> 3.0)
      safe_yaml (~> 1.0)
      terminal-table (~> 1.8)
    jekyll-feed (0.12.1)
      jekyll (>= 3.7, < 5.0)
    jekyll-sass-converter (2.0.1)
      sassc (> 2.0.1, < 3.0)
    jekyll-seo-tag (2.6.1)
      jekyll (>= 3.3, < 5.0)
    jekyll-watch (2.2.1)
      listen (~> 3.0)
    kramdown (2.1.0)
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    liquid (4.0.3)
    listen (3.2.0)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    mercenary (0.3.6)
    minima (2.5.1)
      jekyll (>= 3.5, < 5.0)
      jekyll-feed (~> 0.9)
      jekyll-seo-tag (~> 2.1)
    pathutil (0.16.2)
      forwardable-extended (~> 2.6)
    public_suffix (4.0.1)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    rouge (3.11.1)
    safe_yaml (1.0.5)
    sassc (2.2.1)
      ffi (~> 1.9)
    terminal-table (1.8.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    thread_safe (0.3.6)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    tzinfo-data (1.2019.3)
      tzinfo (>= 1.0.0)
    unicode-display_width (1.6.0)
    wdm (0.1.1)

PLATFORMS
  ruby

DEPENDENCIES
  jekyll (~> 4.0.0)
  jekyll-feed (~> 0.12)
  minima (~> 2.5)
  tzinfo (~> 1.2)
  tzinfo-data
  wdm (~> 0.1.1)

BUNDLED WITH
   2.0.2
Geelong answered 4/11, 2019 at 7:25 Comment(0)
V
10
  • Edit your Gemfile to look like this :
source 'https://rubygems.org'
gem 'github-pages'
  • Remove your Gemfile.lock

  • Launch a bundle command.

That's it ! You're ready to deploy to github pages.

Vareck answered 5/11, 2019 at 0:48 Comment(1)
This worked for me, but I didn't need to edit my Gemfile to look like that..Opium
R
1

This is occurring because you are requesting conflicting versions of Jeykll. One option is to downgrade the version of Jeykll you are using by changing it in your Gemfile

-jekyll (~> 4.0.0)
+jekyll (~> 3.3)

and then running bundle update jekyll

If you wanted to run the latest version, you could fork the Gem, update the jekyll dependency version and test the changes. If it is working as expected you should submit a PR to the original repo and could use the fork while waiting for it to be merged.

Redbug answered 4/11, 2019 at 7:32 Comment(4)
In my Gemfile, it is defiend as gem "jekyll", "~> 4.0.0". So I changed it to gem "jekyll", "~> 3.3" but it gives me an more error. It says, Bundler could not find compatible versions for gem "jekyll": In Gemfile: github-pages was resolved to 4, which depends on jekyll (= 1.1.2)Geelong
And what do you mean by fork the Gem??? What is PR also?Geelong
Try running bundle update to see if that fixes it. Forks are outlined here - help.github.com/en/github/getting-started-with-github/… Pull-requests - help.github.com/en/github/… How to use a fork in your Gemfile bundler.io/v1.12/git.htmlRedbug
I ran into the same problem with "jekyll-theme-minimal". I tried using gem "jekyll", "~> 3.9" and that worked.Akee
S
1

Version 3.7 worked for me, you could try and check the same.

Spang answered 5/4, 2020 at 5:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.