Jekyll:错误:无法构建网站,日期格式错误

问题描述 投票:0回答:1

当我在命令行中运行此命令时:

$ bundle exec jekyll serve

我收到此错误:

无效日期“”:文档“vendor/cache/gems/jekyll-3.3.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb”中没有有效日期YAML 前面的内容。

错误文件中的前面内容如下所示:

---
layout: post
title:  "Welcome to Jekyll!"
date:   <%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>
categories: jekyll update
---

我已经更新了我的 gems 并安装了 Xcode。但我仍然收到此错误。我运行这个:

Macbook, macOS Sierra, 10.12

你能帮忙吗?

ruby-on-rails terminal jekyll
1个回答
5
投票

如果您使用

--path
标志通过捆绑包安装 gems,则需要排除
vendor
文件,因此您只需在
vendor
文件中添加
_config.yml
即可。

title: Lorem ipsum
author: Lorem
...
exclude:
  - Gemfile
  - Gemfile.lock
  - vendor
© www.soinside.com 2019 - 2024. All rights reserved.