2

I've just started with Jekyll and have been working through tutorials. I wanted to try one of the supported gem-based themes instead of the default Minima theme. Running on localhost:4000 ...

No matter what I do, my site renders using the Minima theme. I've read elsewhere about pages not rendering because of mis-matched front matter or different default directories. That's not happening to me.

My page always renders as if the theme is Minima.

This is my Gemfile:

source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins
gem "jekyll-theme-cayman"
gem "jekyll-theme-hacker"
gem "minima"

I updated _config.yml to use a specific theme:

theme: jekyll-theme-hacker

When I run bundle install everything looks fine .. no errors.

When I run bundle exec jeckyll build, also no warnings or errors.

What am I missing?

bortman
  • 41
  • 3

2 Answers2

2

TL;DR: I'm chalking this up to conflicting versions of jekyll. At various points I found jekyll versions 3.0.1, 3.6.2, and 3.7.3. I removed all versions then installed 3.7.3

Details: I decided to make a new site to test things, and then tried changing themes in a similar manner to my original question. What I noticed was that the new site's Gemfile and _config.yml looked different than those from the old site. And, the Gemfile explicitly specified gem "jekyll", "~> 3.7.2", whereas my old Gemfile didn't have this line. That is what prompted me to look into version conflicts.

Last week I installed jekyll via apt-get. This was the version that was installed:

bortman@computer:ga_blog$ jekyll --version
jekyll 3.0.1

Last night I reinstalled and this happened:

bortman@computer:ga_blog$ sudo gem install jekyll
Successfully installed jekyll-3.7.3
Parsing documentation for jekyll-3.7.3
Done installing documentation for jekyll after 0 seconds
1 gem installed


bortman@computer:ga_blog$ bundle exec jekyll --version
jekyll 3.6.2

Clearly, something was up with versions. So, I did:

bortman@computer:ga_blog$ sudo apt-get --purge autoremove jekyll

bortman@computer:ga_blog$ sudo gem install jekyll
Successfully installed jekyll-3.7.3
Parsing documentation for jekyll-3.7.3
Done installing documentation for jekyll after 0 seconds
1 gem installed

bortman@computer:ga_blog$ jekyll --version
WARN: Unresolved specs during Gem::Specification.reset:
  rouge (< 4, >= 1.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
jekyll 3.7.3

Though I get a warning, everything seems to be working fine now. I tried to do gem cleanup rouge, like they did here, but still get the same warning.

Changing themes now works as expected.

I guess I should have avoided apt-get and used the gem to install.

bortman
  • 41
  • 3
0

As mentioned on GitHub repo of the theme here you need to define the group of the gem in order to be previewed locally.

source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins
gem "jekyll-theme-cayman"
gem "jekyll-theme-hacker", group: :jekyll_plugins
gem "minima"

this might be your issue.

dstrants
  • 7,423
  • 2
  • 19
  • 27
  • your suggestion didn't do it. I updated my Gemfile to include `gem "jekyll-theme-hacker", group: :jekyll_plugins` .. site still renders with Minima. Also, the Github repo specifies to add `gem "github-pages", group: :jekyll_plugins` .. this is already in my Gemfile – bortman Mar 18 '18 at 13:05
  • did you run `bundle install` and then restart the server? – dstrants Mar 18 '18 at 16:59
  • 1
    Yes, I did `bundler install`. No errors, but it didn't fix the problem .. page still renders with Minima. I think there are bigger issues involved. I'll post what I find in an "answer" to my own question soon. – bortman Mar 19 '18 at 23:31