无法在预览服务器上构建站点

无法在预览服务器上构建站点

本文介绍了无法在预览服务器上构建站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是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

I am a beginner on jekyll. I am following the documentation advice to Build the site on the preview server.Here is what a did :
- install the last version of ruby
$ruby -v -> ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
$ gem --version -> 2.6.14
- Install Jekyll$gem install jekyll bundler -> Version of jekyll : jekyll-3.6.2

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

When I try to build the site on the preview server (bundle exec jekyll serve) there is the following error :

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

jekyll 3.6.2 | Error: (/Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml): did not find expected key while parsing a block mapping at line 16 column 1

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

the line 16 is the first line uncommented that shoul be processed. It is this one

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

我看不出有什么问题.预先感谢您的回答

I don't see what can be wrong. Thank you in advance for your answers

推荐答案

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

Yaml files are sensitive to spaces, in your _config.yml you have:

# 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:之前的空格.然后它应该起作用.

Note the space before exclude:. Then it should work.

这篇关于无法在预览服务器上构建站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 05:32