From d8dfc436303e0e1284a4bb2fbbbfd8c6ad1882c3 Mon Sep 17 00:00:00 2001
From: Alex Reisner <alex@alexreisner.com>
Date: Mon, 7 Mar 2011 15:30:30 -0500
Subject: [PATCH] Raise exception if no JSON parser found.

---
 lib/geocoder/lookups/base.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/geocoder/lookups/base.rb b/lib/geocoder/lookups/base.rb
index 3d8c66fe..ae8c8cf5 100644
--- a/lib/geocoder/lookups/base.rb
+++ b/lib/geocoder/lookups/base.rb
@@ -75,6 +75,9 @@ module Geocoder
           end
         elsif defined?(ActiveSupport::JSON)
           ActiveSupport::JSON.decode(raw_data)
+        else
+          raise Geocoder::Error, "No JSON-parsing library found. " +
+            "Please install either the 'json' or 'activesupport' gem."
         end
       end
 
-- 
GitLab