diff --git a/lib/licensed/sources/bundler.rb b/lib/licensed/sources/bundler.rb index 0e894200..b2a80c3a 100644 --- a/lib/licensed/sources/bundler.rb +++ b/lib/licensed/sources/bundler.rb @@ -109,9 +109,11 @@ def with_application_environment # reset bundler to load from the current app's source path ::Bundler.reset! - ::Bundler.load end + # ensure the bundler environment is loaded before enumeration + ::Bundler.load + yield end ensure @@ -119,8 +121,10 @@ def with_application_environment # restore bundler configuration ENV.replace(backup) ::Bundler.reset! - ::Bundler.load end + + # reload the bundler environment after enumeration + ::Bundler.load end # Returns whether the current licensed execution is running ruby-packer