Jekyll报错解决:GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.

2020/02/23 行走的问题解决机 共 3205 字,约 10 分钟

早上在本地构建博客时报错如下:

xxx.github.io>jekyll serve
 Incremental build: disabled. Enable with --incremental
      Generating...
   GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 443)
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 443)
   GitHub Metadata: An existing connection was forcibly closed by the remote host. - SSL_connect
   GitHub Metadata: Failed to open TCP connection to api.github.com:443 (No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 443)
   GitHub Metadata: An existing connection was forcibly closed by the remote host. - SSL_connect
   GitHub Metadata: An existing connection was forcibly closed by the remote host. - SSL_connect
   GitHub Metadata: An existing connection was forcibly closed by the remote host. - SSL_connect
       Jekyll Feed: Generating feed for posts
  Liquid Exception: undefined method `map' for false:FalseClass Did you mean? tap in /_layouts/post.html
                    ------------------------------------------------
      Jekyll 4.0.0   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------

里面有报错GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.Failed to open TCP connection to api.github.com:443 (No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 443)

解决方法参考官方文档:github-metadata/authentication.md at master · jekyll/github-metadata

先打开https://github.com/settings/tokens/new,权限不用选,默认是public repository

生成token后运行:

JEKYLL_GITHUB_TOKEN=your_token jekyll serve

如果是windows用户,可以把变量增加到系统的环境变量中。


如果报错如下:

 Incremental build: disabled. Enable with --incremental
      Generating...
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
   GitHub Metadata: No internet connection. GitHub metadata may be missing or incorrect.
       Jekyll Feed: Generating feed for posts
  Liquid Exception: undefined method `map' for false:FalseClass Did you mean? tap in /_layouts/post.html
                    ------------------------------------------------
      Jekyll 4.0.0   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------

那么在_config.yml中添加github: [metadata]

文档信息

Table of Contents