How to run “bundle exec jekyll new .”

坚强是说给别人听的谎言 提交于 2020-06-14 05:57:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!