From 10c1a5affd756e2fa4a139fd41c2d2c69ad41210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 28 Oct 2021 19:56:56 +0200 Subject: [PATCH] Don't mutate bundler dependencies in place `Bundler.require` returns the set of dependencies bundler definition is considering for the current invocation. And those dependencies were being filtered and the ones outside of plugins' groups removed (`puma` is usually one of these). `Bundler.definition.specs` materializes the current dependencies into a set of requirable specifications. However, since some dependencies had been wiped out after the plugin manager had done its thing, the corresponding specs would no longer be materialized and would be missing. This commit fixes the problem by not mutating bundler dependencies in-place. --- bridgetown-core/lib/bridgetown-core/plugin_manager.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bridgetown-core/lib/bridgetown-core/plugin_manager.rb b/bridgetown-core/lib/bridgetown-core/plugin_manager.rb index b5d9b31c4..6b4493ddb 100644 --- a/bridgetown-core/lib/bridgetown-core/plugin_manager.rb +++ b/bridgetown-core/lib/bridgetown-core/plugin_manager.rb @@ -44,8 +44,7 @@ def self.require_from_bundler if !ENV["BRIDGETOWN_NO_BUNDLER_REQUIRE"] && File.file?("Gemfile") require "bundler" - required_gems = Bundler.require PLUGINS_GROUP - required_gems.select! do |dep| + required_gems = Bundler.require(PLUGINS_GROUP).select do |dep| (dep.groups & [PLUGINS_GROUP]).any? && dep.should_include? end