问题
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
回答1:
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
来源:https://stackoverflow.com/questions/59913903/how-to-run-bundle-exec-jekyll-new