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

2

6

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

Hulburt answered 10/6, 2020 at 22:49 Comment(0)
D
4

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.

Douglassdougy answered 19/7, 2020 at 9:58 Comment(1)
For me it was also the underscores which made it work, but I couldn't find what the underscores actually mean/do for this command.Exeunt
B
3

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!

Backdrop answered 11/6, 2020 at 4:16 Comment(4)
Step 5 threw an error: zsh: command not found: jekyll. Why would this have happened given I installed via gem install --user-install bundler jekyll? The output for that command in the next comment.Hulburt
``` Fetching bundler-2.1.4.gem WARNING: You don't have /Users/vishrutarya/.gem/ruby/2.7.0/bin in your PATH, gem executables will not run. Successfully installed bundler-2.1.4 Parsing documentation for bundler-2.1.4 Done installing documentation for bundler after 2 seconds Fetching jekyll-4.1.0.gem Successfully installed jekyll-4.1.0 Parsing documentation for jekyll-4.1.0 Done installing documentation for jekyll after 0 seconds 2 gems installed ``` Is the problem "You don't have /Users/vishrutarya/.gem/ruby/2.7.0/bin in your PATH"?Hulburt
For step 5 : if your system and project use different Jekyll gem then to get the project's Jekyll version, execute command bundle exec jekyll -v --> this will return jekyll 3.8.7 along with some warningsNicias
@Nicias that makes more sense, I've updated my answer. Thanks!Backdrop

© 2022 - 2024 — McMap. All rights reserved.