Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upInitializers and react-rails gem placement in Gemfile suspect load order issue with `after: :load_config_initializers` option #1033
Comments
|
Sounds like an interesting discovery. It could be good to see how other popular rails gems tie in and change to modern good practice just as a matter of course, especially if we do end up showing this is causing an issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm sorry to post an issue that is missing crucial evidence, but some debugging of a recent config loading bug makes me suspect that the react-rails
railtie.rbmay be modifying the load order of initializers, and preventing the values inRails.application.configbeing as expected.Whether this happens or not appears to be partly dependent on where in the
Gemfilethereact-railsgem is loaded. Placingreact-railsat the very end of theGemfileseems to help.One suspect for changing the load order of initializers is the use of the
after: :load_config_initializersoption throughout react-rails'railtie.rb.I couldn't find an explanation for this however Rails has removed one use of the
after: :load_config_initializersoption from its ownactive_support/railtie.rbwith this comment:Some testing of commenting out the
after: :load_config_initializersoptions in the react-railsrailtie.rbdid seem to alleviate the load order issue I was seeing when loading thereact-railsgem.I've not been able to get to the bottom of this yet I'm afraid, so I'm posting this here in the hope that other developers will encounter this, add their experience, and help resolve.