Skip to content

Load Jekyll plugins from BUNDLE_GEMFILE location#8585

Merged
jekyllbot merged 1 commit intojekyll:masterfrom
bglw:fix/gemfile-discovery
May 16, 2021
Merged

Load Jekyll plugins from BUNDLE_GEMFILE location#8585
jekyllbot merged 1 commit intojekyll:masterfrom
bglw:fix/gemfile-discovery

Conversation

@bglw
Copy link
Copy Markdown
Contributor

@bglw bglw commented Feb 18, 2021

This is a 🐛 bug fix.

  • ✅  I've added tests 🎉
  • ✅  The test suite passes locally 🎉

Summary

Before telling bundler to load plugins in the :jekyll_plugins group, plugin_manager.rb checks for the existence of a Gemfile in the current working directory.
In some setups, the Gemfile may live elsewhere and be referenced using the BUNDLE_GEMFILE environment variable. In this case, the Gemfile check will fail and the :jekyll_plugins group will not be loaded.
Bundler is aware of the file (since the gems still resolve), so all we need to do is expand the check for a Gemfile to include the BUNDLE_GEMFILE environment variable.

Reproduction

For a given Jekyll site with plugins referenced in the Gemfile and not in the _config.yml, run the following in the parent directory:

export BUNDLE_GEMFILE=src/Gemfile 
bundle install
bundle exec jekyll build --source src

The plugins in the Gemfile plugins group will not be loaded.

Context

I haven't found an existing issue or PR referencing this.

@DirtyF DirtyF requested review from a team, ashmaroli and parkr and removed request for a team March 26, 2021 14:13
@DirtyF DirtyF added the fix label Mar 26, 2021
Copy link
Copy Markdown
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks, this needs another pair or eyes from our Core Team.

@DirtyF
Copy link
Copy Markdown
Member

DirtyF commented May 16, 2021

@jekyll: merge +fix

@jekyllbot jekyllbot merged commit 93ef938 into jekyll:master May 16, 2021
@jekyllbot jekyllbot added the bug label May 16, 2021
jekyllbot added a commit that referenced this pull request May 16, 2021
@DirtyF DirtyF removed request for ashmaroli and parkr May 16, 2021 20:06
github-actions bot pushed a commit that referenced this pull request May 16, 2021
Liam Bigelow: Load Jekyll plugins from BUNDLE_GEMFILE location (#8585)

Merge pull request 8585
@jekyll jekyll locked and limited conversation to collaborators May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants