简体   繁体   English

Jekyll网站仅在推送到GitHub时失败

[英]Jekyll site fails only when pushed to GitHub

I am developing a new version of a static website with Jekyll that deployed via Github pages: https://devcampy.com 我正在使用Jekyll开发通过Github页面部署的静态网站的新版本: https : //devcampy.com

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

Locally I run it with docker, and I am not able to reproduce the issue: 我在本地使用docker运行它,但无法重现该问题:

$ 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 非常感谢

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. /node_modules/bootstrap/scss/vendor/_rfs.scss丢失,因为.gitignore规则阻止对任何供应商文件夹进行版本控制。

  1. In your .gitignore , replace vendor line by vendor/bundle 在您的.gitignore中 ,将vendor行替换为vendor/bundle

  2. run npm install bootstrap to override current version 运行npm install bootstrap以覆盖当前版本

The error is telling what the problem is. 错误告诉问题是什么。 You have this on the line in main.scss 您可以在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. 我认为其中之一应该起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM