Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0. #572

Closed
dorianmariecom opened this issue Sep 6, 2024 · 1 comment

Comments

@dorianmariecom
Copy link

previous ref: #561
pr that didn't fix the warning: #562

I was shown a warning so I did:

module Warning
  def warn(msg)
    raise msg
  end
end

and now I have the full backtrace:

Bundler::GemRequireError:
  There was an error while trying to load the gem 'jbuilder'.
  Gem Load Error is: /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
  You can add ostruct to your Gemfile or gemspec to silence this warning.

  Backtrace for gem load error is:
  /Users/dorianmariefr/src/dorianmariecom/code/spec/spec_helper.rb:5:in `warn'
  <internal:warning>:51:in `warn'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:70:in `block (2 levels) in replace_require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:in `require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/jbuilder-2.12.0/lib/jbuilder.rb:9:in `<top (required)>'
  <internal:/Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
  <internal:/Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:in `require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/runtime.rb:55:in `each'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/runtime.rb:55:in `block in require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/runtime.rb:44:in `each'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/runtime.rb:44:in `require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler.rb:212:in `require'
  /Users/dorianmariefr/src/dorianmariecom/code/config/application.rb:7:in `<top (required)>'
  /Users/dorianmariefr/src/dorianmariecom/code/config/environment.rb:3:in `require_relative'
  /Users/dorianmariefr/src/dorianmariecom/code/config/environment.rb:3:in `<top (required)>'
  /Users/dorianmariefr/src/dorianmariecom/code/spec/rails_helper.rb:7:in `require_relative'
  /Users/dorianmariefr/src/dorianmariecom/code/spec/rails_helper.rb:7:in `<top (required)>'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require'
  /Users/dorianmariefr/src/dorianmariecom/code/spec/features/generate_and_evaluate_program_spec.rb:3:in `<top (required)>'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/configuration.rb:2139:in `load'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/configuration.rb:2139:in `load_file_handling_errors'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/configuration.rb:1638:in `block in load_spec_files'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/configuration.rb:1636:in `each'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/configuration.rb:1636:in `load_spec_files'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/runner.rb:102:in `setup'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/runner.rb:86:in `run'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/runner.rb:71:in `run'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/lib/rspec/core/runner.rb:45:in `invoke'
  /Users/dorianmariefr/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/rspec-core-3.13.1/exe/rspec:4:in `<top (required)>'
  bin/rspec:31:in `load'
  bin/rspec:31:in `<main>'
  Bundler Error Backtrace:

I think it would be better removing open struct all together

@skipkayhil
Copy link
Member

There's an open PR #567

@dhh dhh closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants