Ruby 3.4.1 generating warning about redefining 'object_id' in FacebookAds::AdAccount
Which SDK version are you using?
facebookbusiness-21.0.2
What's the issue?
Upgraded from Ruby 3.3 to 3.4.1 and this gem is generating the following logs:
.rvm/gems/ruby-3.4.1/gems/facebookbusiness-21.0.2/lib/facebook_ads/fields.rb:30: warning: redefining 'object_id' may cause serious problems
Steps/Sample code to reproduce the issue
Load the FacebookAds::AdAccount class
Observed Results:
$ irb
> FacebookAds::AdAccount
/Users/ben/.rvm/gems/ruby-3.4.1/gems/facebookbusiness-21.0.2/lib/facebook_ads/fields.rb:30: warning: redefining 'object_id' may cause serious problems
/Users/ben/.rvm/gems/ruby-3.4.1/gems/facebookbusiness-21.0.2/lib/facebook_ads/fields.rb:30: warning: redefining 'object_id' may cause serious problems
/Users/ben/.rvm/gems/ruby-3.4.1/gems/facebookbusiness-21.0.2/lib/facebook_ads/fields.rb:30: warning: redefining 'object_id' may cause serious problems
/Users/ben/.rvm/gems/ruby-3.4.1/gems/facebookbusiness-21.0.2/lib/facebook_ads/fields.rb:30: warning: redefining 'object_id' may cause serious problems
Expected Results:
- What did you expect to happen?
Either suppress the warning if it's actually safe, or a different approach.
+1
Issue is also present on version 20.0.4 and 21.0.2(the latest public version at the time this comment is posted)
The object_id method is now explicitly defined in Ruby 3.4.0, as discussed here: https://bugs.ruby-lang.org/issues/20912.
I believe the library should be updated to avoid redefining or overriding the built-in object_id method.
Clarification: The object_id method has always existed in Ruby, but Ruby 3.4.0 introduced an explicit warning when attempting to redefine it
I'm encountering the same issue with version 23.0.0. My Ruby version is 3.4.5.
Is there any plan to resolve this issue or a known workaround?
+1