Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 8 migration failing due to opaque deprecation description

Migrating from rails 7.1 to 7.2, the following warning was issued:

DEPRECATION WARNING: ActiveSupport::ProxyObject is deprecated and will be removed in Rails 8.0.
Use Ruby's built-in BasicObject instead.
 (called from <main> at .../config/application.rb:7)

which corresponds to the uncommented line

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

However, this reader does not make any connection between the config line nor the warning. Nothing in this regard in the release notes for upgrading addresses this specifically.

The upgrade to 8 upon rails app:update returns

/Users/deploy/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': cannot load such file -- active_support/basic_object (LoadError)
[...  and a bit later a curious entry ...]
    from bin/rails:4:in `<main>'
/Users/deploy/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': cannot load such file -- active_support/proxy_object (LoadError)

How can I be enlightened here? How can this configuration line be changed to use BasicObject ?

like image 438
Jerome Avatar asked Aug 31 '25 03:08

Jerome


1 Answers

I was able to find out which gems were using this class by running

grep -r "ActiveSupport::ProxyObject" $(bundle show --paths) .

For me it returned these gems:

/usr/local/bundle/gems/delayed_job-4.1.10/lib/delayed/compatibility.rb:        ActiveSupport::ProxyObject
/usr/local/bundle/gems/jbuilder-2.11.5/lib/jbuilder/jbuilder.rb:  ActiveSupport::ProxyObject
like image 59
Hunter Avatar answered Sep 02 '25 16:09

Hunter