Skip to content

Instantly share code, notes, and snippets.

@evanphx
Created July 3, 2013 23:53
Show Gist options
  • Save evanphx/5923876 to your computer and use it in GitHub Desktop.
Save evanphx/5923876 to your computer and use it in GitHub Desktop.
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index ad2ec26..d468393 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -181,7 +181,12 @@ module Gem
# require will try to activate the more specific version.
spec = Gem::Specification.find_inactive_by_path path
- return false unless spec
+
+ unless spec
+ spec = Gem::Specification.find_by_path path
+ return true if spec.activated?
+ false
+ end
begin
spec.activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment