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=-2.7 required=3.0 tests=AWL,BAYES_00, 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 3C1DD1F453 for ; Thu, 17 Jan 2019 12:52:46 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 15F1B120EA7; Thu, 17 Jan 2019 21:52:42 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 6A3FB120E93 for ; Thu, 17 Jan 2019 21:52:40 +0900 (JST) Received: by filter0183p3mdw1.sendgrid.net with SMTP id filter0183p3mdw1-24956-5C407A93-2D 2019-01-17 12:52:35.98448777 +0000 UTC m=+211701.683229290 Received: from herokuapp.com (ec2-3-81-3-226.compute-1.amazonaws.com [3.81.3.226]) by ismtpd0032p1iad2.sendgrid.net (SG) with ESMTP id Gs1ZTLCTTRaDj9mG9-hCjA for ; Thu, 17 Jan 2019 12:52:35.927 +0000 (UTC) Date: Thu, 17 Jan 2019 12:52:37 +0000 (UTC) From: hsbt@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66591 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15500 X-Redmine-Issue-Author: mrkn X-Redmine-Issue-Assignee: hsbt X-Redmine-Sender: hsbt 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4uGXyTKZwyggpedS9xmPaALMm+xgI0jAx4cn m3MQjyOGNZQGQjiU7grFpk4zyNEIkHOF+mYJipdmsTQ8ObNZhWkxdaJEwMsy80fs0HaLuTxViTJ05W NZ5bwSQESTTAj1FGFeV2wWVopXbBdxeXofY6EcQn1X4H299/l6dRJxfljw== X-ML-Name: ruby-core X-Mail-Count: 91141 Subject: [ruby-core:91141] [Ruby trunk Bug#15500] Behavior of require method in 2.5 is different from 2.4 and 2.6 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 #15500 has been updated by hsbt (Hiroshi SHIBATA). I could reproduce them. But I also reproduce it with Ruby 2.5.3 with RubyGems 2.6.14.3 bundled with Ruby 2.4. ``` ~ > ruby -v ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18] ~ > gem -v 2.6.14.3 ~ > gem list bigdecimal *** LOCAL GEMS *** bigdecimal (1.4.3, default: 1.3.4) ~ > ruby -e "require 'bigdecimal'; p \$LOADED_FEATURES.grep(/bigdecimal/).first" "/Users/hsbt/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin18/bigdecimal.bundle" ``` It seems this issue produced by Ruby core without RubyGems maybe. ---------------------------------------- Bug #15500: Behavior of require method in 2.5 is different from 2.4 and 2.6 https://bugs.ruby-lang.org/issues/15500#change-76372 * Author: mrkn (Kenta Murata) * Status: Assigned * Priority: Normal * Assignee: hsbt (Hiroshi SHIBATA) * Target version: * ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- On Ruby 2.5, `require 'bigdecimal'` does not load `bigdecimal.so` in gem-installed version of bigdecimal without specifying the version by `gem` method. You can examine this phenomenon by the following code. ```ruby require 'bigdecimal' p $LOADED_FEATURES.grep(/bigdecimal/).first ``` After installing bigdecimal-1.4.2 by `gem install bigdecimal` command, this code (saved as `t.rb`) show the following results: On Ruby 2.4.5 ``` $ ruby-2.4.5 -v t.rb ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-darwin18] "/Users/mrkn/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/bigdecimal-1.4.2/lib/bigdecimal.bundle" ``` On Ruby 2.5.3: ``` $ ruby-2.5.3 -v t.rb ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18] "/Users/mrkn/.rbenv/versions/2.5.3/lib/ruby/2.5.0/x86_64-darwin18/bigdecimal.bundle" ``` On Ruby 2.6.0: ``` $ ruby-2.6.0 -v t.rb ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18] "/Users/mrkn/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bigdecimal-1.4.2/lib/bigdecimal.bundle" ``` On Ruby 2.5.3, with `gem 'bigdecimal', '1.4.2'`, the correct file can be loaded. ``` $ ( echo "gem 'bigdecimal', '1.4.2'"; cat t.rb ) | ruby-2.5.3 -v - ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18] "/Users/mrkn/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bigdecimal-1.4.2/lib/bigdecimal.bundle" ``` -- https://bugs.ruby-lang.org/