Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Try to activate only inactive gems #227

voxik opened this Issue · 3 comments

3 participants



Once the required file is not found by gem_original_require, RubyGems are going through all gems and tries to find which gem can contain the requested file. Unfortunately, it also goes through gems, which were already activated. However, for such gems, it makes no sense to look for some files to load, because their load paths are already available and the Ruby's require would be successful in that case. My simple patch [1] is trying to short-circuit the unnecessary search for files, and searches just the yet inactive gems. This patch should improve the RubyGems require performance, although I did not tested it. In theory, the more gems are activated, the faster should the require be.



Alternative implementation could be extension of the original find_by_path to accept optional parameter with :active, :inactive and :all flags and the search would be modified according to this flag.

@zenspider zenspider was assigned

I like it, but it needs a test.


Hi, the test can be found here:

However, I am not sure if the test itself shouldn't be protected by something like "save_loaded_features" which is used in require tests.

@evanphx evanphx closed this in abfb4b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.