diff --git a/lib/geocoder/lookups/base.rb b/lib/geocoder/lookups/base.rb
index c07080f5b9a2fb43e61524a1de971ef0c595f63b..8b2ddd11dd7ec1c0679862829bb0e54d7573d5b5 100644
--- a/lib/geocoder/lookups/base.rb
+++ b/lib/geocoder/lookups/base.rb
@@ -67,10 +67,10 @@ module Geocoder
       # Parses a raw search result (returns hash or array).
       #
       def parse_raw_data(raw_data)
-        if defined?(JSON)
+        if defined?(JSON) and defined?(JSON.parse)
           begin
             JSON.parse(raw_data)
-          rescue JSON::ParseError
+          rescue
             warn "Geocoding API's response was not valid JSON."
           end
         elsif defined?(ActiveSupport::JSON)