astrobase_go
astrobase_go

Reputation: 11

Local Jekyll build works but fails build in Github

My problem: I am able to build a nice website locally using Jekyll and the Skinny Bones theme, but when I upload my contents to GitHub the build fails.

System information: Running macOS 12.5, Jekyll 4.2.2, most up-to-date version of gems (managed by Bundler). Clean install of everything this morning.

What I've done:

  1. Downloaded all relevant software and built out a GitHub Pages repo per these instructions and the GitHub Pages instructions.
  2. Cloned the project (let's call it project.github.io), unzipped the Skinny Bones theme inside that directory, got everything set up. The directory now looks like:
    • Gemfile
    • Gemfile.lock
    • README.md
    • jekyll
      • _site
      • _pages
      • _layouts
      • a whole lot more
  3. I build everything how I wanted it, navigated to the jekyll folder, and built it using bundle exec jekyll build and checked it interactively using bundle exec jekyll serve. Everything worked well, no errors, functioned as expected.
  4. I then navigated to the project.github.io directory, added everything and pushed it successfully, then got the settings configured for GitHub pages (e.g., set it to the right branch, etc.).
  5. This is where the problem occurs. I notice that the build failed, examined the error log, and see this in the output, two lines:

Conversion error: Jekyll::Converters::Scss encountered an error while converting 'jekyll/css/main.scss': File to import not found or unreadable: variables. Load path: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0/_sass on line 10

/usr/local/bundle/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:123:in "rescue in convert": File to import not found or unreadable: variables. (Jekyll::Converters::Scss::SyntaxError)

The build has therefore failed, and my pages are not rendering. Furthermore, these are supported dependencies, per the GitHub documentation. I have verified that I have the same version of theme-primer installed.

Can anyone help me diagnose this problem?

Upvotes: 0

Views: 441

Answers (1)

astrobase_go
astrobase_go

Reputation: 11

I have solved this issue. The problem is that even though I was pushing all material from the parent, I was building locally from a /blog subdirectory inside my project.github.io parent directory. This was cloned directly from GitHub. When I tried to build locally from the parent, I got the same error as I was getting on GitHub, which tipped me off to what might be going on.

When I moved everything up to the parent directory level and rebuilt from parent, everything worked as expected and just as it did from initially building inside /blog. I pushed to GitHub, the build process completed, and the GitHub page was served.

Hopefully this will be helpful for someone else who might have this issue. Jekyll is adamant about directory hierarchy.

Upvotes: 1

Related Questions