ruckus / quickbooks-ruby

Quickbooks Online REST API V3 - Ruby
MIT License
374 stars 302 forks source link

LoadError (cannot load such file -- rexml/xpath_parser) #598

Open PaulBabka opened 1 year ago

PaulBabka commented 1 year ago

Thanks for this GEM.

Code has been running fine for years, but when I recently upgraded my app to Ruby 3.2.2 and this GEM to 2.0.2, I ran into the above error in some use cases.

I half-assed solved this error by simply adding REXML to my Gemfile, but should not have needed to.

gem 'rexml'

I don't think this is a QUICKBOOKS-RUBY issue per-say, so feel free to close this issue, but it might help someone else.

# Sample code causing the above error Quickbooks::Service::Vendor.new(company_id: 'SOME COMPANY ID', access_token: 'SOME ACCESS TOKEN').find_by(:display_name, 'SOME VENDOR')

REXML should have been included by default (ROXML GEM requirement), but for some reason, its not available (at least for me).

Cheers

kluzny commented 1 year ago

This just happened to me as well on ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]

Curiously, I only see this on recent docker image builds. I suspect the rexml is sitting at 3.2.5 in my gemfile due to development dependencies that may be more up to date.

I suspect that the only difference is that including it in the gemfile directly calls 'require'. I can do a bit more research in a day or two, but I suspect that explicitly requiring this in the code paths that are using this gem might be a more concise solution.

For me, this didn't happen during the grant/callback process but during customer creation, likely when it was juggling all that xml.

adrianne-jetpack commented 2 weeks ago

We started seeing this issue after we bumped to 2.0.5 from 2.0.4 on July 26, 2024. We've taken the corrective action listed above and explicitly require rexml in our gem file. We appreciated very much finding this issue here as it helped us resolve the issue more quickly.