Skip to content

Ruby 3.3 warnings about gems being removed from the standard library #247

@zorab47

Description

@zorab47

General information

  • SDK/Library version: 4.22
  • Environment: Sandbox and Production
  • Language, language version, and OS: Ruby 3.3.x

Issue description

Loading the braintree Ruby gem emits warnings about gems being removed from the standard library in a future version of Ruby. The following gems should be added as dependencies in the gemfile:

  • base64
  • bigdecimal
  • ostruct
❯ ruby -v
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [x86_64-darwin23]

❯ ruby braintree_ruby_dependency_warnings.rb
/Users/$HOME/.gem/ruby/3.3.4/gems/braintree-4.22.0/lib/braintree.rb:1: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec. Also contact author of braintree-4.22.0 to add base64 into its gemspec.
/Users/$HOME/.gem/ruby/3.3.4/gems/braintree-4.22.0/lib/braintree.rb:2: warning: bigdecimal was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add bigdecimal to your Gemfile or gemspec. Also contact author of braintree-4.22.0 to add bigdecimal into its gemspec.

It isn't listed when running require "braintree" but ostruct is another of the gems used in the Braintree::WebhookNotification class. It is listed in my applications log messages when processing webhooks:

/usr/local/bundle/gems/braintree-4.22.0/lib/braintree/webhook_notification.rb:1: 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 reproduce by running the following with Ruby 3.3:

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'braintree', require: false
end

require "braintree"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions