Fix #6 by adding active_support require which ShardThreadRegistry depends on #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @hsgubert !
Thanks for this awesome gem - helped me out big time in upgrading a legacy up while not wanting to give up on sharding
This PR fixes #6
The issue does not occur because of JRuby but because the necessary active_support dependency has not been loaded yet via one of the railties/engines in
config/application.rb
and bundler has not yet required the dependencies from the Gemfile, which also could've setup active_support.I suspect OP in #6 probably had Sprockets and other pieces deactivated in their fresh new app.
By explicitly adding the dependency in
ShardThreadRegistry
this gets fixed.You can reconstruct the scenario by not adding Sprockets to a fresh rails 5.1.7 install:
rails _5.1.7_ new -S broken_app
cd broken_app
bundle add rails-sharding
After adding the dependency fix, everything works fine.
I ran into this issue while checking a client's Gemfile with bumbler