首页 > 解决方案 > 使用旧版本的 jekyll 捆绑

问题描述

我正在尝试使用 jekyll 预览我过去构建的网站。从那以后,我相信 jekyll 已经有了更新,我现在zsh在 MacOS 10.15.2 上使用。我现在无法运行预览,因为它似乎bundle一直在使用旧版本的jekyll.

当我运行时,bundle exec jekyll server --unpublished我收到此错误:

(base) ➜  angoodkind.github.io git:(master) ✗ bundle exec jekyll server --unpublished
Configuration file: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/_config.yml
NOTE: Inheriting Faraday::Error::ClientError is deprecated; use Faraday::ClientError instead. It will be removed in or after version 1.0
Faraday::Error::ClientError.inherited called from /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/vendor/cache/ruby/2.6.0/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:14.
            Source: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io
       Destination: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
Error reading file /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/blog/index.html: (<unknown>): did not find expected key while parsing a block mapping at line 7 column 5
             Error: could not read file /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/vendor/cache/ruby/2.6.0/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/cache/ruby/2.6.0/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/cache/ruby/2.6.0/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.

但是,系统应该使用最近安装的 jekyll 4.0.0。为什么使用 jekyll 3.5.2?

标签: rubyjekyllbundler

解决方案


推荐阅读