Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexKalinin/2fe9396620b06a82b3435d068683bc80 to your computer and use it in GitHub Desktop.
Save AlexKalinin/2fe9396620b06a82b3435d068683bc80 to your computer and use it in GitHub Desktop.
Bundler - prefer local gems
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 236eedd..eb35d3d 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -291,6 +291,10 @@ module Bundler
end
end
+ local = matching_versions.reject { |mv| mv[0].class == Bundler::RemoteSpecification }
+ others = matching_versions - local
+ matching_versions = others + local
+
matching_versions.reverse_each do |spec_group|
conflict = resolve_requirement(spec_group, current, reqs.dup, activated.dup)
conflicts << conflict if conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment