From 78b9b00465dcdf5794a2d4be76f3e1e0199fc4d2 Mon Sep 17 00:00:00 2001 From: Balazs Nagy Date: Sun, 7 Feb 2010 15:31:25 +0100 Subject: [PATCH] Don't require rubygems twice Signed-off-by: Balazs Nagy --- .../lib/active_support/core_ext/kernel/requires.rb | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/kernel/requires.rb b/activesupport/lib/active_support/core_ext/kernel/requires.rb index d223889..cb6678a 100644 --- a/activesupport/lib/active_support/core_ext/kernel/requires.rb +++ b/activesupport/lib/active_support/core_ext/kernel/requires.rb @@ -10,7 +10,9 @@ module Kernel rescue LoadError => cannot_require # 1. Requiring the module is unsuccessful, maybe it's a gem and nobody required rubygems yet. Try. begin - require 'rubygems' + unless defined? Gem + require 'rubygems' + end rescue LoadError => rubygems_not_installed raise cannot_require end -- 1.6.6.1