Skip to content

require 'bundler' should prefer the gemified version #6485

@ahorek

Description

@ahorek

Environment Information
jruby 9.3.0.0-SNAPSHOT (2.6.5) 2020-12-04 d394c27 Java HotSpot(TM) 64-Bit Server VM 11.0.2+9-LTS on 11.0.2+9-LTS +jit [linux-x86_64]

jruby doesn't include binstubs for bundler. So I have to install it

gem install bundler
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Done installing documentation for bundler after 11 seconds
1 gem installed

after running bundle install, the Gemfile.lock includes

BUNDLED WITH
   2.1.4

however, I can't run the application, because require 'bundler' still picks the built-in version, even if bundler 2 is already installed.

You must use Bundler 2 or greater with this lockfile

Expected Behavior

gem list bundler
*** LOCAL GEMS ***
bundler (default: 2.1.4)

ruby -rbundler -e 'puts Bundler::VERSION'
2.1.4

Actual Behavior

gem list bundler
*** LOCAL GEMS ***
bundler (2.1.4)

ruby -rbundler -e 'puts Bundler::VERSION'
1.17.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions