I prefer to install Jekyll to my project directories rather than GEM_HOME. My new project workflow has been to create a Gemfile in the project root with jekyll as a single dependency, and then I do:
bundle install && bundle exec jekyll new . --force --blank
This has worked fine for me so far, but I run into issues when I omit the --blank
option. In this case, as expected, Jekyll proceeds to overwrite my existing Gemfile with its default Gemfile (containing minima, jekyll-feed, etc.), and then it automatically runs bundle install
. However, it chokes, claiming it can’t find the minima gem at any of the gem sources.
Ultimately it’s not a big deal because I can just do another bundle install
afterwards. This successfully installs minima and the other default dependencies - even though bundle install
failed just a moment ago. To avoid errors, instead of doing bundle exec jekyll new . --force
I have been doing bundle exec jekyll new . --force --skip-bundle && bundle install
.
I can also avoid errors by creating the site in a subdirectory (e.g., bundle exec jekyll new example
).
Is this a Jekyll bug? More likely, I imagine there’s something I’m not understanding about bundle exec
. I’m still pretty new to Ruby, Bundler, and Jekyll.