gem "jekyll-remote-theme"
bundle exec jekyll serve
gem "jekyll-remote-theme"
我试图在GitHub页面中使用Jekyll和Minimal Mistakes构建一个博客。在我推动更改之前,我想检查页面上的所有内容是否正常。
bundle exec jekyll new . --force
bundle exec jekyll serve
我遇到与libcurl.dll
相关的错误。以下是Powershell上的消息。
依赖性错误:哎呀!看起来你没有jekyll-remote-theme或o 已安装其依赖项。为了使用当前配置的Jekyll ,你需要安装这个宝石。来自Ruby的完整错误消息是:'可以n ot open library' libcurl' :(非法字符)。无法打开libr ary' libcurl.dll' :(非法字符)。无法打开库&#lib; 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显示 正确呈现的页面如下所示。
顺便说一下,回购是https://github.com/Dixhom/dixhom.github.io/tree/7132905f5515345eb78cd71bdad168a15f906a1c
我怀疑jekyll-remote-theme
没有在当地环境中工作所以我用谷歌搜索了#j; jekyll远程主题服务"这没什么帮助。
Google搜索关键字"远程主题构建警告:布局不存在。"没什么帮助。
我该如何解决这个问题?
答案 0 :(得分:3)
aaaah我也只是反对这一点。我运行bundle exec jekyll serve --verbose
并看到jekyll-remote-theme
从未被初始化(每个插件记录一个Requiring: jekyll-<thing>
行)。然后我在Gemfile中注意到了这个块:
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
我将"gem jekyll-remote-theme"
添加到该插件块并修复了它 - doh!
关于这个Gemfile组的jekyll更新日志中有一些注释,但我没有发现它对解释这里发生的事情非常有帮助。
希望有所帮助!