Jekyll 搭建过程中遇到的问题记录,便于遇到同样问题的朋友查看

1.本地不能访问

问题描述:

在浏览器中不能查看本地效果

http://localhost:4000

解决方法:

检查_config.yml配置文件是否需要修改

2.Jekyll3.0不能编译

问题描述:

Deprecation: You appear to have pagination turned on, but you haven’t included the jekyll-paginate gem. Ensure you have gems: [jekyll-paginate] in your configuration file.

故障原因:

jekyll自3.0版本以后不再支持相对路径,统一用绝对路径。

解决方法:

(1)打开_config.yml文件,将relative_permailinks:true注释掉;

在结尾添加

gems: [jekyll-paginate]

保存;

(2)接下来安装缺失的插件:

gem install pygments.rb

gem install redcarpet

现在编译Jekyll build

3.下载认证文件

curl http://curl.haxx.se/ca/cacert.pem -o cacert.pem

设置环境变量,重新安装

4.:

Dependency Error: Yikes! It looks like you don't have bundler or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- bundler' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
jekyll 3.5.0 | Error:  bundler

安装bundler

gem install bundler

5.:

 Could not find gem 'minima (~> 2.0) x64-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)

安装Ruby环境

 gem install minima

6.:

   Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.

解决方法:

配置文件_config.yml中,使用了 gems 的配置项,应该是用plugins替换掉gems。

7.:

   Configuration file: /_config.yml
            Source: .
       Destination: ./_site
      Generating...
                    done.
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
 Auto-regeneration: enabled for '.'
Configuration file: /_config.yml
jekyll 2.4.0 | Error:  Permission denied - bind(2) for 127.0.0.1:4000

解决方法:

使用 netstat 命令查看各种端口的被进程的占用情况,通过

tasklist /svc /FI "PID eq 11476"

查看具体哪一个进程占用,也可借助于第三方工具完成。