Jekyll site fails only when pushed to GitHub

2020-04-21 03:04发布

I am developing a new version of a static website with Jekyll that deployed via Github pages: https://devcampy.com

The repository: https://github.com/gianarb/devcampy.com

Locally I run it with docker, and I am not able to reproduce the issue:

$ docker run --rm -p 4000:4000 -v "$PWD":/srv/jekyll jekyll/jekyll:stable jekyll serve

This is the error I get via email when I push to the repository. I can't figure out why it does not work properly

The page build failed for the `master` branch with the following error:

Your SCSS file `assets/main.scss` has an error on line 6: File to import not found or unreadable: vendor/rfs. Load paths: node_modules /hoosegow/.bundle/ruby/2.5.0/gems/jekyll-theme-primer-0.5.3/_sass /hoosegow/.bundle/ruby/2.5.0/gems/jekyll-theme-primer-0.5.3/_sass /hoosegow/.bundle/ruby/2.5.0/gems/jekyll-theme-primer-0.5.3/_sass. For more information, see https://help.github.com/en/articles/page-build-failed-invalid-sass-or-scss.

Does somebody have any feedback? Thanks a lot

2条回答
家丑人穷心不美
2楼-- · 2020-04-21 03:40

The error is telling what the problem is. You have this on the line in main.scss

@import "bootstrap/scss/bootstrap";

So this means the file may exist locally but is not able to import on your deploy since it's not there.

Looking at your repo I see you have bootstrap located here:

node_modules/bootstrap/dist/css/bootstrap.min.css

So try this instead:

@import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
// or you could try
@import "../node_modules/bootstrap/scss/bootstrap.scss"

I would think one of those should work.

查看更多
对你真心纯属浪费
3楼-- · 2020-04-21 03:47

Your current bootstrap code is incomplete. /node_modules/bootstrap/scss/vendor/_rfs.scss is missing because of a .gitignore rule that prevent any vendor folder to be versioned.

  1. In your .gitignore, replace vendor line by vendor/bundle

  2. run npm install bootstrap to override current version

查看更多
登录 后发表回答