5

I've made a personal blog with Jakyll on Github Pages, it was working flawlessly with the default theme.

Then I've (locally) installed the theme Minimal Mistakes and worked on it to add some customizations. It works fine locally.

I'm using VS Code on Windows 10.

I then committed and synced the repo but GitHub Pages can't load the new theme apparently. The blog still works with the old one but I've got this error message from GitHUb Pages:

/usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:84:in `rescue in gemspec': The minimal-mistakes-jekyll theme could not be found. (Jekyll::Errors::MissingDependencyException)
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:81:in `gemspec'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:19:in `root'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:12:in `initialize'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:439:in `new'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:439:in `configure_theme'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:55:in `config='
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:23:in `initialize'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:30:in `new'
from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:30:in `process'
from /usr/local/bundle/gems/github-pages-223/bin/github-pages:70:in `block (3 levels) in <top (required)>'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /usr/local/bundle/gems/github-pages-223/bin/github-pages:6:in `<top (required)>'
from /usr/local/bundle/bin/github-pages:23:in `load'
from /usr/local/bundle/bin/github-pages:23:in `<main>'

/usr/local/lib/ruby/2.7.0/rubygems/dependency.rb:311:in to_specs': Could not find 'minimal-mistakes-jekyll' (>= 0) among 159 total gem(s) (Gem::MissingSpecError) Checked in 'GEM_PATH=/github/home/.gem/ruby/2.7.0:/usr/local/lib/ruby/gems/2.7.0:/usr/local/bundle', execute gem envfor more information from /usr/local/lib/ruby/2.7.0/rubygems/dependency.rb:323:into_spec' from /usr/local/lib/ruby/2.7.0/rubygems/specification.rb:986:in find_by_name' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:82:in gemspec' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:19:in root' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/theme.rb:12:in initialize' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:439:in new' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:439:in configure_theme' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:55:in config=' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/site.rb:23:in initialize' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:30:in new' from /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:30:in process' from /usr/local/bundle/gems/github-pages-223/bin/github-pages:70:in block (3 levels) in <top (required)>' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go' from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program' from /usr/local/bundle/gems/github-pages-223/bin/github-pages:6:in <top (required)>' from /usr/local/bundle/bin/github-pages:23:in load' from /usr/local/bundle/bin/github-pages:23:in `' Logging at level: debug Configuration file: /github/workspace/./_config.yml Theme: minimal-mistakes-jekyll github-pages 223 | Error: The minimal-mistakes-jekyll theme could not be found.

I've originally installed (and developed the whole blog) Ruby 3.0. I suspect GitHub Pages needs 2.7.0?

You can have a look at my repo here

mauromotion
  • 71
  • 1
  • 4
  • I have the same issue. Did you find a solution? – eliascis Sep 14 '22 at 13:17
  • 1
    It's down here... Long story short: check your gem file and config.yml, chances are you haven't followed the instructions correctly, there's nothing wrong with the theme. Double check with other people's configurations files on github and you should be fine. – mauromotion Sep 15 '22 at 15:15
  • Had the same problem. Thanks @mauromotion. I copied over your config and gemfile and it worked! I'm going to start customizing these for my use now. – user9944315 Sep 25 '22 at 15:47

2 Answers2

2

From what I know, GitHub Pages Jekyll generator is quite limited at what it can do. It doesn't support too much customization, especially not adding new gems. What you actually need to do is to push a static CSS/HTML site into GitHub Pages... generated with Jekyll, BUT for example by GitHub Actions.

All this is counter-intuitive, I know. But the solution is fairly simple.

All you need to do, is to follow the instruction located here: https://github.com/helaili/jekyll-action

The guide tells you, that all you need to do is to create a .github/workflows/pages.yml with the following content:

name: Testing the GitHub Pages publication

on:
  push

jobs:
  jekyll:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    # Use GitHub Actions' cache to shorten build times and decrease load on servers
    - uses: actions/cache@v2
      with:
        path: vendor/bundle
        key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
        restore-keys: |
          ${{ runner.os }}-gems-

    # Standard usage
    - uses:  helaili/jekyll-action@v2
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

And change the publishing branch to gh-pages afterwards.

hmdne
  • 434
  • 2
  • 5
  • No thanks, this was super confusing. This is a completely different procedure from what I actually used and wasn't helpful. But thanks anyway. – mauromotion Feb 08 '22 at 20:27
  • I understand this. Github Pages were created a long time ago and I also expected a different behavior when creating my Jekyll blog. But things have gotten a little bit more complicated since then. From what I know, what I described is kind of a standard way to publish things to GHP supporting all kinds of static page generators, not only Jekyll. – hmdne Feb 10 '22 at 01:51
2

I was confusing the use of the remote theme plugin with the Gem theme method, doing a bit of both locally. I've cleaned up my Gemfile and my _config.yml and now it's all working properly.

The fact that I used Ruby 3.0 locally and then Github Pages uses 2.7 doesn't matter apparently.

mauromotion
  • 71
  • 1
  • 4