ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: hsbt@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:90983] [Ruby trunk Bug#15500][Assigned] Behavior of require method in 2.5 is different from 2.4 and 2.6
Date: Thu, 10 Jan 2019 08:56:58 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-76200.20190110085657.c2b9ea93bc25f599@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15500.20190103053456@ruby-lang.org

Issue #15500 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Assigned
Assignee set to hsbt (Hiroshi SHIBATA)

----------------------------------------
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-76200

* 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/

  parent reply	other threads:[~2019-01-10  8:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15500.20190103053456@ruby-lang.org>
2019-01-03  5:34 ` [ruby-core:90867] [Ruby trunk Bug#15500] Behavior of require method in 2.5 is different from 2.4 and 2.6 muraken
2019-01-03  6:40 ` [ruby-core:90868] " ruby-core
2019-01-03  7:13 ` [ruby-core:90869] " muraken
2019-01-10  8:56 ` hsbt [this message]
2019-01-17 12:52 ` [ruby-core:91141] " hsbt
2019-01-19  3:37 ` [ruby-core:91168] " hsbt
2019-01-24  1:00 ` [ruby-core:91238] " naruse
2019-01-24  6:06 ` [ruby-core:91245] " muraken
2019-02-05 12:15 ` [ruby-core:91408] " nagachika00

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-76200.20190110085657.c2b9ea93bc25f599@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).