# Jekyll Serve gives Invalid date '\<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %\>'

**URL:** <https://talk.jekyllrb.com/t/jekyll-serve-gives-invalid-date-time-now-strftime-y-m-d-h-m-s-z/6605>\
**Category:** Help\
**Created:** [October 24, 2021, 4:57pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-gives-invalid-date-time-now-strftime-y-m-d-h-m-s-z/6605 "2021-10-24T16:57:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesdhope](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jamesdhope](https://talk.jekyllrb.com/u/jamesdhope)\
**Post date:** [October 24, 2021, 4:57pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-gives-invalid-date-time-now-strftime-y-m-d-h-m-s-z/6605/1 "2021-10-24T16:57:26Z")

</div>

Hello,

I am trying to serve and receiving the following error. Any guidance appareciated.

\_config.yaml has:

```auto
exclude:
   - Gemfile
   - Gemfile.lock
   - node_modules
   - vendor/bundle/
   - vendor/cache/
   - vendor/gems/
   - vendor/ruby/

```

```auto
(base) jamess-MacBook-Pro-2:jekyll_site jamesdhope$ bundle exec jekyll serve --incremental
Configuration file: /Users/jamesdhope/Documents/Projects/jamesdhope.github.io/jekyll_site/_config.yml
            Source: /Users/jamesdhope/Documents/Projects/jamesdhope.github.io/jekyll_site
       Destination: /Users/jamesdhope/Documents/Projects/jamesdhope.github.io/jekyll_site/_site
 Incremental build: enabled
      Generating... 
             Error: could not read file /Users/jamesdhope/Documents/Projects/jamesdhope.github.io/jekyll_site/vendor/bundle /gems/jekyll-3.5.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle /gems/jekyll-3.5.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/bundle /gems/jekyll-3.5.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
(base) jamess-MacBook-Pro-2:jekyll_site jamesdhope$ 

```

---

<div class="post-metadata">

**Author:** ![fabiomux](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/fabiomux/32/2656_2.png) [@fabiomux](https://talk.jekyllrb.com/u/fabiomux)\
**Post date:** [October 27, 2021, 1:58pm UTC](https://talk.jekyllrb.com/t/jekyll-serve-gives-invalid-date-time-now-strftime-y-m-d-h-m-s-z/6605/2 "2021-10-27T13:58:05Z")

</div>

Looks like you have a space in the path between _bundle_ and _gems_: _bundle /gems_ while in the _exclude_ section you haven’t considered it.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [October 28, 2021, 5:08am UTC](https://talk.jekyllrb.com/t/jekyll-serve-gives-invalid-date-time-now-strftime-y-m-d-h-m-s-z/6605/3 "2021-10-28T05:08:07Z")

</div>

> [@jamesdhope](#):
>
> ` 'vendor/bundle /gems/`

Indeed that looks like the issue.

Try delete vendor

Then set up again

```auto
bundle config set --local path 'vendor/bundle'

```

Here are my regular bundle commands for reference

> <https://github.com/MichaelCurrin/jekyll-blog-demo/blob/master/Makefile>

* * *

By the way your excludes bit can also be much shorter

```auto
exclude:
   - Gemfile # implies Gemfile* so matches Gemfile.lock
   - node_modules/ 
   - vendor/ # matches vendor/*

```

Here is my template file

> <https://github.com/MichaelCurrin/jekyll-blog-demo/blob/bba9bc5f3b0e0c78c3c066354bd05a5222817ee2/_config.yml#L37>
