Error upon `bundle exec jekyll 3.8.7 new .` for Github Pages

Viewed 755

Goal

Initiate a Github Page using Jekyll. I'm following the Github Pages docs.

Problem

Upon executing:

bundle exec jekyll 3.8.7 new .

The following error is returned:

fatal: 'jekyll 3.8.7' could not be found. You may need to install the jekyll-3.8.7 gem or a related gem to be able to use this subcommand..

Also note that (a) Jekyll 3.8.7 is the current dependency version for Github Pages and (b) the same error is returned if I attempt it for Jekyll 4.1.0.

Context

I tried the recommendation in this SO post -- $ bundle init, $ bundle add jekyll -- but that didn't solve my problem.

System details:

$ which ruby
/Users/vishrutarya/.rbenv/shims/ruby

$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]

$ jekyll -v
jekyll 4.1.0

$ which jekyll
/Users/vishrutarya/.gem/ruby/2.7.0/bin/jekyll

2 Answers

For me, adding underscores did the trick. I installed version 3.8.7 manually. With gem list, you can check if it is actually installed. Then i used bundle exec jekyll _3.8.7_ new . --force and it worked.

Ran into the same issue on MacOS. This is what I ended up doing:

  1. Create a new dir, let's call it blog
  2. Run bundle init
  3. In the Gemfile, add the line gem "jekyll", "= 3.8.7"
  4. Run bundle i
  5. You can verify the jekyll version by issuing bundle exec jekyll -v
  6. Create a docs/ directory in the same folder
  7. Run bundle exec jekyll new .
  8. Run bundle i again in docs/ directory
  9. To serve, run bundle exec jekyll serve in the docs/ directory

I hope this helps!

Related