From: richard.schneeman+ruby-lang@... Date: 2019-02-25T22:38:49+00:00 Subject: [ruby-core:91622] [Ruby trunk Bug#15622] Default version of Bundler incorrectly invoked when using binstubs Issue #15622 has been reported by schneems (Richard Schneeman). ---------------------------------------- Bug #15622: Default version of Bundler incorrectly invoked when using binstubs https://bugs.ruby-lang.org/issues/15622 * Author: schneems (Richard Schneeman) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- When trying to run a binstub with Ruby 2.6.1 with Bundler 2.0.1 on the system, the wrong version of Bundler gets loaded which then fails when the Gemfile.lock points to a 2.x version (since the default version that ships with Ruby is Bundler 1.x. While this was discovered on Heroku and is discussed in this issue https://github.com/heroku/heroku-buildpack-ruby/issues/856#issuecomment-467205932 I was able to replicate the problem fairly easily with docker. I've provided instructions below. ## Reproduction Start a docker image with Ruby 2.6.1 ``` docker run -it --rm ruby:2.6.1 bash ``` Install bundler, rails, make a new app, and remove the `begin/rescue/end` from the `bin/rake` binstub. To trigger the error run a `rake` command without `bundle exec`: ``` gem install bundler -v 2.0.1 gem install rails -v 6.0.0.beta1 rails new ruby-2-6-bundler-2-issue cd ruby-2-6-bundler-2-issue cat < bin/rake #!/usr/bin/env ruby require_relative '../config/boot' require 'rake' Rake.application.run EOT rake -T ``` Output: ``` You must use Bundler 2 or greater with this lockfile. ``` Expected: Bundler 2 is available on the system, and is the latest version, so it should be invoked instead of the default bundler version. -- https://bugs.ruby-lang.org/ Unsubscribe: