Trouble creating a new jekyll site: "Could not locate Gemfile or .bundle/ directory"
Asked Answered
W

1

15

I am trying to create a Jekyll site hosted on GitHub Pages, and have been following the GitHub Pages tutorial to do so.

When I run bundle exec jekyll 4.0.1 new in the terminal (as in step 7 in the tutorial, 4.0.1 being the version of jekyll on my machine), it fails with Could not locate Gemfile or .bundle/ directory.

I've double checked the dependencies with jekyll -v, git --version, bundler -v, ruby -v, gem -v and all are installed so I'm not sure where I've gone wrong.

I'm running macOS 10.15.4.

Watt answered 9/5, 2020 at 21:30 Comment(0)
R
17

I had the same problem recently (and actually came across this question while searching for an answer).

Following the instructions on jekyllrb.com/tutorials/using-jekyll-with-bundler helped me get my site running. I think bundle init is the command you need to avoid the error you see (it creates a Gemfile), but then there are other errors, so I had to run the following commands to get my website working.

$ cd my-jekyll-website
$ bundle init
$ bundle add jekyll
$ bundle exec jekyll new --force --skip-bundle .

Then I followed the GitHub tutorial's steps to update the gem "github-pages" line in the Gemfile, and then I ran bundle install. After that, bundle exec jekyll serve worked, and I could see the new website locally.

I am using Ubuntu 20.04, so hopefully these instructions work for you too.

Rosaniline answered 6/7, 2020 at 13:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.