Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 7 has removed ActiveSupport::Dependencies. How should reloading be done now? #2238

Open
mileslane opened this issue Feb 7, 2022 · 6 comments

Comments

@mileslane
Copy link

#358
https://github.com/ruby-grape/grape#reloading-api-changes-in-development
We have:

 ActiveSupport::Dependencies.explicitly_unloadable_constants += [
    'GrapeAPI::V1::RootEndpoint',
    'GrapeAPI::RootEndpoint'
  ]
@Mortle
Copy link

Mortle commented Feb 20, 2023

Any updates on this?

@dblock
Copy link
Member

dblock commented Feb 21, 2023

Any updates on this?

No updates. AFAIK nobody is working on this.

@prateekvyas1212
Copy link

prateekvyas1212 commented Sep 27, 2023

i am stuck here. any help?
NoMethodError: undefined method `explicitly_unloadable_constants' for ActiveSupport::Dependencies:Module

@blshkv
Copy link

blshkv commented Mar 16, 2024

It sounds like it's time to move away from grape to something like pure API with VueJS, or Turbo from Hotwire

@dblock
Copy link
Member

dblock commented Mar 16, 2024

It sounds like it's time to move away from grape to something like pure API with VueJS, or Turbo from Hotwire

We'll miss you, @blshkv!

@wqsaali
Copy link

wqsaali commented Oct 11, 2024

The method ActiveSupport::Dependencies.explicitly_unloadable_constants has been removed in Rails 7, which is why you're seeing a NoMethodError. This method was part of Rails' older autoloading system, but Rails 7 fully relies on the Zeitwerk autoloader, which does not use manually unloadable constants.

To fix this, you need to migrate away from explicitly_unloadable_constants and rely on Zeitwerk’s autoloading, which handles reloading of constants automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants