Project

General

Profile

Actions

Bug #20713

closed

Ruby 3.3.5 triggers a deprecation warning with `require "json"`

Added by Bo98 (Bo Anderson) 8 days ago. Updated 6 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:119033]

Description

Can be reproduced with bundle exec ruby -e "require 'json'":

/opt/hostedtoolcache/Ruby/3.3.5/x64/lib/ruby/3.3.0/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.

Likely needs a backport of https://github.com/ruby/ruby/commit/066bd28cff75b752b0af90dce933fa382dee0406.

Updated by hsbt (Hiroshi SHIBATA) 8 days ago

  • Status changed from Open to Closed

You can suppress that warning with json-2.7.2.

Updated by Bo98 (Bo Anderson) 8 days ago · Edited

Ah is the default json gem no longer supported too? This broke REXML CI: https://github.com/ruby/rexml/actions/runs/10695343850/job/29648614890 because rdoc uses json from the standard library and I see the same warning from running rdoc elsewhere. Should rdoc depend on the json from RubyGems instead?

Updated by vo.x (Vit Ondruch) 7 days ago

I think that if Bundler is used, that means gems are used and they should always fully specify their dependencies. The other way is to not use Bundler.

Updated by hsbt (Hiroshi SHIBATA) 7 days ago

  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED

Updated by Earlopain (A S) 7 days ago · Edited

I believe reline requires a PR like that as well: bundle exec ruby -e "require 'reline'"

/home/user/.rbenv/versions/3.3.5/lib/ruby/3.3.0/reline.rb:9: warning: fiddle was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0

0.5.9 has some changes related to making fiddle more optional. Currently ruby contains 0.5.7

I'm also seeing a warning for rdoc when doing bundle exec irb but its not showing what gem is responsible: rdoc was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0. (that's the whole line)

Updated by Earlopain (A S) 6 days ago

The rdoc warning is from irb itself: https://github.com/ruby/irb/pull/999

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0