Skip to content
This repository
Browse code

Fixed buggy gem activation. Don't pass a dependency to gem, pass the

name and requirement. Better, just activate the spec for the
dependency (1.8 only)
  • Loading branch information...
commit 4c3725723f15fab0a424cb1318b82b460714b72f 1 parent c20a4d1
Ryan Davis authored

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  railties/lib/rails/gem_dependency.rb
8  railties/lib/rails/gem_dependency.rb
@@ -72,7 +72,13 @@ def add_load_paths
72 72
         @load_paths_added = @loaded = @frozen = true
73 73
         return
74 74
       end
75  
-      gem self
  75
+
  76
+      begin
  77
+        self.to_spec.activate           # >= 1.8 happy way
  78
+      rescue
  79
+        gem self.name, self.requirement # <  1.8 unhappy way
  80
+      end
  81
+
76 82
       @spec = Gem.loaded_specs[name]
77 83
       @frozen = @spec.loaded_from.include?(self.class.unpacked_path) if @spec
78 84
       @load_paths_added = true

0 notes on commit 4c37257

Please sign in to comment.
Something went wrong with that request. Please try again.