rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 1.99k forks source link

Bundler does not vendor net-http-pipeline gem. #7521

Closed marciotoshio closed 4 years ago

marciotoshio commented 4 years ago

If we already have the net-http-pipeline gem installed and try to vendor it the gem is not vendored because Bundler loads it before vendoring (https://github.com/bundler/bundler/blob/master/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb#L7).

To reproduce this:

1- Gemfile

    source "https://rubygems.org"
    gem 'net-http-pipeline'

1- bundle install 1- bundle install --path vendor/bundle`` 1-bundle check`

Bundle check gives this:

The following gems are missing
 * net-http-pipeline (1.0.1)
Install missing gems with `bundle install`
deivid-rodriguez commented 4 years ago

Oh wow, I had no idea about this hidden dependency. Since the dependency is optional (require error is swallowed, and we're not using it), the simplest solution here seems to remove the require from the version we are vendoring.