From 5132081975810afade4d783e68731b06d7f37665 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 30 Jul 2010 16:05:51 -0300 Subject: AS gem doesn't depend on nokogiri so shows a nicer error if users haven't installed --- activesupport/lib/active_support/xml_mini/nokogiri.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/xml_mini/nokogiri.rb') diff --git a/activesupport/lib/active_support/xml_mini/nokogiri.rb b/activesupport/lib/active_support/xml_mini/nokogiri.rb index eb61a7fc22..e03a744257 100644 --- a/activesupport/lib/active_support/xml_mini/nokogiri.rb +++ b/activesupport/lib/active_support/xml_mini/nokogiri.rb @@ -1,4 +1,9 @@ -require 'nokogiri' +begin + require 'nokogiri' +rescue LoadError => e + $stderr.puts "You don't have nokogiri installed in your application. Please add it to your Gemfile and run bundle install" + raise e +end require 'active_support/core_ext/object/blank' # = XmlMini Nokogiri implementation -- cgit v1.2.3