Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run "bundle exec jekyll new ."

I'm trying to follow "Creating a GitHub Pages site with Jekyll" but when I run any of these commands:

$ bundle exec jekyll VERSION new .
$ bundle exec jekyll _4.0.0_ new .
$ bundle exec jekyll 4.0.0 new .

I get this error:

"Could not locate Gemfile or .bundle/ directory"

I have looked at several SO posts related to this error message, but none seem to have a fix for my problem. Perhaps I have missed something?

Some relevant details:

$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
$ jekyll -v
jekyll 4.0.0
$ type rvm | head -n 1
rvm is a function
$  lsb_release -a
LSB Version:    core-11.0.1ubuntu1-noarch:printing-11.0.1ubuntu1-noarch:security-11.0.1ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:    19.10
Codename:   eoan
like image 860
user2901351 Avatar asked Jan 25 '20 22:01

user2901351


People also ask

What does bundle exec Jekyll serve do?

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. Bundler can be a great tool to use with Jekyll.

What is bundle exec command?

bundle exec is a Bundler command to execute a script in the context of the current bundle (the one from your directory's Gemfile). rake db:migrate is the script where db is the namespace and migrate is the task name defined.


1 Answers

The GitHub walk-through left these commands out, but Bundler's bundle init explains it:

This command is necessary to create the Gemfile:

$ bundle init

and this one to populate it with Jekyll:

$ bundle add jekyll

so that when I re-ran my setup command, it worked:

$ bundle exec jekyll 4.0.0 new . --force

The specific version of jekyll that GitHub uses can be found here.

like image 104
user2901351 Avatar answered Nov 13 '22 14:11

user2901351