braintree_ruby icon indicating copy to clipboard operation
braintree_ruby copied to clipboard

Ruby 3.3 warnings about gems being removed from the standard library

Open zorab47 opened this issue 1 year ago • 3 comments

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"

zorab47 avatar Oct 01 '24 20:10 zorab47

This also happens on Ruby 3.4, which is out now.

BrianHawley avatar Jan 31 '25 16:01 BrianHawley

Loading the braintree library on Ruby 3.4 errors due to missing dependencies: base64 and bigdecimal. I'll open another issue for Ruby 3.4.

zorab47 avatar Jan 31 '25 17:01 zorab47

Is this gem still under maintenance? Ruby 3.3 has been out almost two years now, and fixing this should be as easy as adding three lines to the Gemfile.

@klaguerrePay I noticed you were the last to respond on the issue list, is there someone we should ping to make this happen?

Fjan avatar Oct 22 '25 11:10 Fjan