Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

find the spec from the source index, then activate it

  • Loading branch information...
commit a2a34133d8347d83c015b1889a774c718644e4d6 1 parent 79aa54d
@tenderlove tenderlove authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 railties/lib/rails/gem_dependency.rb
View
4 railties/lib/rails/gem_dependency.rb
@@ -74,7 +74,9 @@ def add_load_paths
end
begin
- self.to_spec.activate # >= 1.8 happy way
+ dep = Gem::Dependency.new(name, requirement)
+ spec = Gem.source_index.find { |_,s| s.satisfies_requirement?(dep) }.last
+ spec.activate # a way that exists
rescue
gem self.name, self.requirement # < 1.8 unhappy way
end
Please sign in to comment.
Something went wrong with that request. Please try again.