【发布时间】:2018-07-21 13:30:09
【问题描述】:
摘要
- 我想在本地机器上看到 Jekyll 使用
gem "jekyll-remote-theme"制作的页面 - 所以我跑了
bundle exec jekyll serve - 但是出现了一个空白页
我想要实现的目标
- 在本地机器上查看 Jekyll 使用
gem "jekyll-remote-theme"创建的页面。
我正在尝试使用 Jekyll 和 Minimal Mistakes 在 GitHub Pages 中构建博客。在推送更改之前,我想检查一下页面是否一切正常。
环境
- Windows 8.1 64 位
- ruby 2.4.3p205(2017-12-14 修订版 61247)[x64-mingw32]
- 杰基尔 3.6.2
我做了什么
bundle exec jekyll new . --force- 用GitHub Pages Method安装了主题
bundle exec jekyll serve
实际发生了什么
我遇到了与libcurl.dll 相关的错误。这是 Powershell 上的消息。
依赖错误:哎呀!看起来你没有 jekyll-remote-theme 或 o 没有安装它的依赖项。为了使用当前配置的 Jekyll ,您需要安装此 gem。来自 Ruby 的完整错误消息是:'Could n 未打开库“libcurl”:(非法字符)。无法打开库 ary 'libcurl.dll':(非法字符)。无法打开库'lib curl.so.4':(非法字符)。无法打开库'libcurl.so .4.dll':(非法字符)'如果遇到麻烦,可以找 https://jekyllrb.com/help/ 的有用资源!
我按照GitHub Pages Dependencies Missing · Issue #17 · benbalter/jekyll-remote-theme中的说明进行操作,问题解决了。
然后bundle exec jekyll serve 出现了另一个错误。本地创建的页面是空白的。 http://127.0.0.1:4000/ 什么也没显示。
PS E:\workspace\mysite\dixhom.github.io> bundle exec jekyll serve
Configuration file: E:/workspace/mysite/dixhom.github.io/_config.yml
Source: E:/workspace/mysite/dixhom.github.io
Destination: E:/workspace/mysite/dixhom.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Remote Theme: Using theme mmistakes/minimal-mistakes
Build Warning: Layout 'single' requested in _posts/2018-02-06-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in 404.html does not exist.
Build Warning: Layout 'page' requested in about.md.bak does not exist.
Build Warning: Layout 'home' requested in index.html does not exist.
Build Warning: Layout 'home' requested in index.md.bak does not exist.
done in 5.423 seconds.
Auto-regeneration: enabled for 'E:/workspace/mysite/dixhom.github.io'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
看起来jekyll 无法读取布局文件。此外,_layouts 目录不在我创建bundle exec jekyll new 的目录中。但是默认情况下,what's in the _layouts directory is packaged in a theme 所以看不到目录是正常的。所以我只是将_layouts 从minimal-mistakes GitHub repo 复制到本地目录作为解决方法。
然后,引发了另一个错误。
PS E:\workspace\mysite\dixhom.github.io> bundle exec jekyll serve
Configuration file: E:/workspace/mysite/dixhom.github.io/_config.yml
Source: E:/workspace/mysite/dixhom.github.io
Destination: E:/workspace/mysite/dixhom.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Remote Theme: Using theme mmistakes/minimal-mistakes
Liquid Exception: Could not locate the included file 'sidebar.html' in any of ["E:/workspace/mysite/dixhom.github.io/_
includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site sourc
e. in /_layouts/single.html
jekyll 3.6.2 | Error: Could not locate the included file 'sidebar.html' in any of ["E:/workspace/mysite/dixhom.github.i
o/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site so
urce.
我本可以以同样的方式复制_includes,但我认为问题的核心在于jekyll 未能从例如 GitHub 存储库中读取必要的文件。
奇怪的是当我将本地更改推送到 GitHub 时,GitHub Pages 显示 正确呈现的页面,如下所示。
顺便说一下,repo 是https://github.com/Dixhom/dixhom.github.io/tree/7132905f5515345eb78cd71bdad168a15f906a1c
我怀疑 jekyll-remote-theme 在本地环境中不起作用,所以我在 Google 上搜索了“jekyll 远程主题服务”,但没有帮助。
谷歌搜索关键字,如“远程主题构建警告:布局不存在”。没有太大帮助。
-
jekyll - Github Pages renders blank page - Stack Overflow
不同的。在本地机器上工作,而不是在 github 页面上 -
Jekyll on github doesn't works the same as local jekyll server - Stack Overflow
一样。 -
Jekyll works locally but comes up blank on github pages - Help - Jekyll Talk
- 一样。 -
Blank new blog generated with Jekyll-3.2.1 on Windows · Issue #5192 · jekyll/jekyll
乍一看似乎很相关,但它是关于基于 Gem 的主题,而不是远程主题。
我该如何解决这个问题?
【问题讨论】:
标签: ruby windows github jekyll github-pages