braintree / braintree_ruby

Braintree Ruby library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
446 stars 195 forks source link

LoadError: cannot load such file -- rexml/document in Ruby 3.0.1 #214

Closed ArturT closed 3 years ago

ArturT commented 3 years ago

General information

Issue description

I've upgraded Ruby from 2.7.1 to Ruby 3.0.1 in my Rails application. I use braintree 4.0.0 gem.

I noticed an error when my API received a webhook from Braintree.

LoadError: cannot load such file -- rexml/document

for this line:

webhook_notification = Braintree::WebhookNotification.parse(params[:bt_signature], params[:bt_payload])

I added rexml gem to my Gemfile and it fixed the issue.

I believe in Ruby 3.0.1 the rexml is not part of stdlib so it must be explicitly defined as a dependency in gemspec for braintree gem.

scannillo commented 3 years ago

Hi @ArturT - thank you for opening this issue, and for using Braintree Ruby.

Looks like you are correct in that in Ruby 2.6 and 2.7 rexml is a default gem, whereas in Ruby 3 rexml is a separate bundled gem.

We will keep you posted when we get a fix out for this!

scannillo commented 3 years ago

👋 Hello @ArturT - we released a fix for this in Braintree Ruby v4.1.0. Thank you for opening the issue!