【问题标题】:Cannot Build the site on the preview server无法在预览服务器上构建站点
【发布时间】:2018-01-01 18:43:40
【问题描述】:

我是 jekyll 的初学者。我正在按照文档建议在预览服务器上构建站点。 这是一个做了什么:
- 安装最新版本的 ruby​​
$ruby -v -> ruby​​ 2.4.1p111(2017-03-22 修订版 58053)[x86_64-darwin16]
$ gem --version -> 2.6.14
- 安装 Jekyll $gem install jekyll bundler -> jekyll 版本:jekyll-3.6.2

当我尝试在预览服务器(bundle exec jekyll serve)上构建站点时,出现以下错误:

杰基尔 3.6.2 |错误:(/Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml):在第 16 行第 1 列解析块映射时未找到预期密钥

第 16 行是应处理的未注释的第一行。就是这个

title: Inger Hair at Home at Aix en Provence (line 16)

我看不出有什么问题。提前感谢您的回答

【问题讨论】:

标签: jekyll


【解决方案1】:

Yaml 文件对空格很敏感,在您的 _config.yml 中有:

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
 exclude:
   - Gemfile
   - Gemfile.lock
   - node_modules
   - vendor/bundle/
   - vendor/cache/
   - vendor/gems/
   - vendor/ruby/
   - Inger-Analytics-feb0aa8b73d1.json
   - .gitignore

什么时候应该:

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
   - Gemfile
   - Gemfile.lock
   - node_modules
   - vendor/bundle/
   - vendor/cache/
   - vendor/gems/
   - vendor/ruby/
   - Inger-Analytics-feb0aa8b73d1.json
   - .gitignore

注意exclude: 之前的空格。那么它应该可以工作了。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-07-06
  • 1970-01-01
  • 2023-03-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-29
相关资源
最近更新 更多