Skip to content

RorVsWild Gem - ActiveSupport::ProxyObject Deprecation Warning in Rails 7.2 #38

@lentrup

Description

@lentrup

Description

I'm receiving deprecation warnings related to ActiveSupport::ProxyObject after upgrading to Rails 7.2. The warnings appear to be coming from the RorVsWild gem:

DEPRECATION WARNING: ActiveSupport::ProxyObject is deprecated and will be removed in Rails 8.0.
Use Ruby's built-in BasicObject instead.
 (called from <top (required)> at /Users/loerus/code/lentrup/metarina/config/application.rb:11)

Context

  • Rails version: 7.2.2.1
  • Ruby version: 3.3.7
  • RorVsWild gem version: 1.9.1

The warning is triggered when my application loads my exception tracking wrapper that uses the RorVsWild gem. I'm requiring my exception tracker in the application.rb file:

# config/application.rb
require_relative "boot"
require "rails/all"
require "./lib/exception_tracker"  # This line triggers the warning

My exception tracker module is a simple wrapper around RorVsWild:

# lib/exception_tracker.rb
module ExceptionTracker
  class << self
    extend Forwardable
    def_delegators ::RorVsWild, :record_error, :catch_error
    # ...
  end
end

Question

Is the RorVsWild gem using ActiveSupport::ProxyObject internally? If so, are there plans to update it to use Ruby's BasicObject to be compatible with future Rails versions?

Temporary Workaround

I've implemented a temporary workaround by:

  1. Creating an initializer that silences the deprecation warning:
# config/initializers/rorvswild.rb
ActiveSupport::Deprecation.silence do
  RorVsWild.start(api_key: ENV.fetch("RORVSWILD_API_KEY", nil))
end
  1. Rearranging my application.rb to load my exception tracker after Bundler loads all gems

Additional Information

This deprecation was introduced in Rails 7.2 and according to the warning, ActiveSupport::ProxyObject will be removed entirely in Rails 8.0. It would be helpful to know if there are plans to update the gem to address this before Rails 8.0 is released.

Thank you :)

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