Skip to content

Conversation

@tatematsu-k
Copy link

@tatematsu-k tatematsu-k commented Jan 16, 2025

Context

Starting from Ruby 3.5, ostruct is no longer included in the standard library and must be explicitly added as a dependency. Without this change, the following warning appears in production environments:

root@43c58a12ab7e:/app# bundle exec rails c
/bundle/ruby/3.4.0/gems/graphql-2.4.8/lib/graphql/subscriptions/serialize.rb:3: warning: /usr/local/lib/ruby/3.4.0/ostruct.rb 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.
Also please contact the author of graphql-2.4.8 to request adding ostruct into its gemspec.
Loading development environment (Rails 8.0.1)

Changes

  • Added ostruct to the gemspec to ensure compatibility with Ruby 3.5 and prevent the warning from being raised.

Reproduction environment

  • Ruby: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [aarch64-linux]
  • Rails: 8.0.1

Notes

This change ensures smooth operation for users upgrading to Ruby 3.5. Thank you for reviewing this PR!

@rmosolgo
Copy link
Owner

Hey, thanks for this suggestion. I ended up taking another approach -- I removed the dependency on ostruct in #5199.

@rmosolgo rmosolgo closed this Jan 16, 2025
@tatematsu-k tatematsu-k deleted the feature/add_ostruct_for_ruby_3_5 branch January 21, 2025 03:34
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

Successfully merging this pull request may close these issues.

2 participants