diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/spec_set.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 599b5cf439..9586521b27 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -295,15 +295,12 @@ module Bundler end def sorted - rake = @specs.find {|s| s.name == "rake" } - begin - @sorted ||= ([rake] + tsort).compact.uniq - rescue TSort::Cyclic => error - cgems = extract_circular_gems(error) - raise CyclicDependencyError, "Your bundle requires gems that depend" \ - " on each other, creating an infinite loop. Please remove either" \ - " gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again." - end + @sorted ||= ([@specs.find {|s| s.name == "rake" }] + tsort).compact.uniq + rescue TSort::Cyclic => error + cgems = extract_circular_gems(error) + raise CyclicDependencyError, "Your bundle requires gems that depend" \ + " on each other, creating an infinite loop. Please remove either" \ + " gem '#{cgems[0]}' or gem '#{cgems[1]}' and try again." end def extract_circular_gems(error) |