Jekyll:错误:无法建立网站,日期格式错误 [英] Jekyll: Error: Site could not be built, wrong date format

查看:56
本文介绍了Jekyll:错误:无法建立网站,日期格式错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When I run this in my command line:

$ bundle exec jekyll serve

我收到此错误:

无效日期'':文档'vendor/cache/gems/jekyll-3.3.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb'没有有效的日期在YAML前线.

Invalid date '': Document 'vendor/cache/gems/jekyll-3.3.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.

错误文件中的最前面的内容是这样的:

The front matter in the faulty file looks like this:

---
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上运行它.

I have updated my gems and installed Xcode. But I still get this error. I run this on: Macbook, macOS Sierra, 10.12.

你能帮忙吗?

推荐答案

我遇到了同样的问题,并通过

I had same problem and I solved with this comment. Thank you @adeluccar

如果使用--path标志安装捆绑销售的gem,则需要排除vendor文件,因此只需在_config.yml文件中添加vendor.

If you install gems with bundle using --path flag you need to exclude vendor file, so you just need to add vendor in the _config.yml file.

title: Lorem ipsum
author: Lorem
...
exclude:
  - Gemfile
  - Gemfile.lock
  - vendor

这篇关于Jekyll:错误:无法建立网站,日期格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆