问题描述
使用终端运行bundle exec jekyll serve
或jekyll serve
时出现错误。
我有一个基于最小错误主题的静态网站,并将其发布在Github上。在编辑网站时,通常我通常使用Jekyll在本地检查网站(在本地运行要快得多,然后将更改推送到网站并等待更改发生)。但是由于某些原因,我无法再使用Jekyll在本地运行该网站,这给了我下面描述的错误。
要重现该错误,可以执行以下操作(假设您已经installed Jekyll):
- 我将
git clone https://github.com/mmistakes/minimal-mistakes.git
克隆到某个文件夹的最小错误主题 - 然后
cd
进入minimal-mistakes
文件夹 - 运行
bundle exec jekyll serve
要检查编辑更改,我曾经做过以下事情:
Run `jekyll serve` in the directory of theme contents
[!] There was an error parsing `Gemfile`:
[!] There was an error while loading `minimal-mistakes-jekyll.gemspec`: No such file or directory - git ls-files -z. Bundler cannot continue.
# from C:/Users/Dell/Desktop/New folder/minimal-mistakes/minimal-mistakes-jekyll.gemspec:14
# -------------------------------------------
# spec.add_development_dependency "rake",">= 12.3.3"
> end
# # coding: utf-8
# -------------------------------------------
. Bundler cannot continue.
# from C:/Users/Dell/Desktop/New folder/minimal-mistakes/Gemfile:2
# -------------------------------------------
# source "https://rubygems.org"
> gemspec # source "https://rubygems.org"
# -------------------------------------------
解决方法
您是否尝试过在bundle
之前运行bundle exec jekyll serve
?