less than 1 minute read

1 安装

apt install ruby ruby-dev
gem install bundler jekyll
# cd 工程目录
bundle exec jekyll serve
bundle install

2 报错

  1. Jekyll serve 启动失败
WARN: Unresolved specs during Gem::Specification.reset:
      jekyll-watch (~> 2.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Configuration file: /smartadpole.github.io/_config.yml
            Source: /smartadpole.github.io
       Destination: /smartadpole.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 16.287 seconds.
FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info on how to fix this.

解决echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
WARN: Unresolved specs during Gem::Specification.reset:
解决bundle exec jekyll serve
Incremental build: disabled. Enable with --incremental
解决bundle exec jekyll serve --incremental

  1. 构建速度慢
    解决nohup bundle exec jekyll serve --drafts --incremental &
    需要把 nohup.out 文件加入到 _config.yml 的 exclude 列表才能避免死循环 exclude: [“nohup.out”]

writing…… :ghost:


TOP

附录

A 推荐资料

  1. Jekyll 的基本用法

Categories: ,

Updated:

Comments