cannot load such file -- enumerator (LoadError)
ruby-progressbar in combination with others gems requiring enumerator.rb file cause error
cannot load such file -- enumerator (LoadError)
if they are loaded in specify order.
Steps to Reproduce
In our application we have several dependencies
- https://rubygems.org/gems/ruby-msg
- https://rubygems.org/gems/roo-xls which require "enumerator" for some reasons.
One of our gem require "ruby-progressbar" and by accident its named is alphabetically before ruby-msg.
Application is not able to start because error cannot load such file -- enumerator (LoadError) on ruby 3+ (tested, but I think 2.7+, because https://bugs.ruby-lang.org/issues/10902)
Expected Behavior
@luk4s I'm going to need a sample program to reproduce this. There is no reason why calling require "enumerator" should load the refinement from this library. The only thing that would load this refinement is require "ruby-progressbar/refinements/enumerator". That file is not even loaded by default and must be called explicitly.
I now know what's going on here. I'm closing this in favor of the PR.
Hi @jfelchner I prepared for you copy of our application with additional gems which cause it this order error, check our repo pls. https://git.easy.cz/redmine/package/-/tree/progressbar_test_enumerator
@luk4s can we get a smaller reproduction case that I can put into a test? Seems like this should be reproducible in like 4 or 5 lines of code.
@luk4s I released 1.13.0rc1. You will have to explicitly require it in your app because it's a non-stable version (gem 'ruby-progressbar', '~> 1.13.0rc1')
Please let me know if this resolves the issue.
✅ I can confirm that v1.13.0rc1 works - it did not cause "enumerator error" 👍 good job
Thank you
Thank you! ❤️