You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I attempted to utilize the gem with the most recent version of Rails (7.1.1), but it appears there is an issue with files loading. Below, I outline the steps to replicate the issue:
Hey @safeforge, thanks for bringing this to our attention. I followed the steps you posted to create a new Rails app and was able to reproduce the behavior you're seeing. Curiously, the same behavior does not appear in a new Rails 7.0 app. I've played around a bit trying to figure it out, and it looks like something changed in the way 7.1 adds to the Ruby load path. Even more curiously, the issue doesn't appear to happen in the github.com repo, which has been running 7.1 for months now. I'll try to get to the bottom of the issue today.
hey @camertron thank you for the prompt response. I have the same feeling, it's related to the load path upgrade introduced in Rails 7.1 and the new defaults. In fact, if you revert the defaults in the application from 7.1 to 7, it works correctly.
classApplication < Rails::Application# Initialize configuration defaults for originally generated Rails version.config.load_defaults7.0end
I attempted to activate each feature individually listed in new_framework_defaults_7_1.rb, and the application still works properly. The issue only arises when the application starts with the 7.1 defaults.
Ok, I think I've figured this out. Rails 7.1 no longer adds eager load paths to the Ruby load path, meaning you can no longer require files that have been added to Rails' eager load paths. Instead Zeitwerk autoloads the correct file whenever the corresponding constant is referenced. This has been possible for a long time in Rails, but 7.1 removed the ability to require at all. I have therefore removed the offending require. Here's the PR: #2336
I attempted to utilize the gem with the most recent version of Rails (7.1.1), but it appears there is an issue with files loading. Below, I outline the steps to replicate the issue:
Running the application with the command
rails s
raises an error in the browserThe text was updated successfully, but these errors were encountered: