skip to Main Content

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

3

Answers


  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.

    Login or Signup to reply.
    • 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.

    Login or Signup to reply.
  2. Version 3.7 worked for me, you could try and check the same.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search