From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.1 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 4940620248 for ; Mon, 25 Feb 2019 22:38:56 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4C7AF12184C; Tue, 26 Feb 2019 07:38:52 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id C2F65121067 for ; Tue, 26 Feb 2019 07:38:49 +0900 (JST) Received: by filter0029p3las1.sendgrid.net with SMTP id filter0029p3las1-22810-5C746E77-22 2019-02-25 22:38:47.722075755 +0000 UTC m=+144303.377536830 Received: from herokuapp.com (ec2-54-166-78-40.compute-1.amazonaws.com [54.166.78.40]) by ismtpd0028p1iad2.sendgrid.net (SG) with ESMTP id C_i90hh0TGWgIUNvoapFdQ for ; Mon, 25 Feb 2019 22:38:47.595 +0000 (UTC) Date: Mon, 25 Feb 2019 22:38:49 +0000 (UTC) From: richard.schneeman+ruby-lang@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 67072 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15622 X-Redmine-Issue-Author: schneems X-Redmine-Sender: schneems X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5As08FRQwJKBr/on8wLFjvkRx3/9dzLQNb7p aXKXnAAsAiVQ/fEyNQ0jNSJkQ4/lUojUYpuxNoOzx7mGngb4jaTA2ci0iIFc7xU7CZi1O8RjZZbdjy gxpm5Mop3su3mebpET6aSUDf3RB7Cs9hNGV2gXb13tgt8QAPsU36tItQRwnvPMEnHJhykquQK6lMoR k= X-ML-Name: ruby-core X-Mail-Count: 91622 Subject: [ruby-core:91622] [Ruby trunk Bug#15622] Default version of Bundler incorrectly invoked when using binstubs X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/