-1

I am getting an error while running bundle exec jekyll serve or jekyll serve using a terminal.

I have a static website build on top of a minimal mistakes theme and its posted on Github. While editing the website, usually I used to check the website locally using Jekyll (much faster to run locally then push the changes to the website and wait until the changes take place). But for some reason I can not run the website locally using Jekyll anymore, it gives me the error described below.

To reproduce the error you can do the following (assuming that you have already installed Jekyll ):

  1. I git clone minimal mistakes theme to a certain folder using git clone https://github.com/mmistakes/minimal-mistakes.git
  2. Then cd into the minimal-mistakes folder
  3. Run bundle exec jekyll serve

To check the editing changes I used to do the following:

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"
 #  -------------------------------------------
  • Few things I noted. Space in folder name "New Folder" (I doubt it might have some effect but be in safe zone by renaming it to name without space), and perform "bundle install" to install required gems. – Dhanu Gurung Sep 09 '20 at 05:50

2 Answers2

0

Have you tried running bundle before bundle exec jekyll serve?

Bailey S
  • 597
  • 1
  • 6
  • 13
0

I encountered the same problem when I was using minimal mistakes. In my case the problem was caused becuase I didn't have git installed - the command 'git ls-files -z' that the error code refers to requires it. Installing git solved the problem.

SeBeast
  • 47
  • 5