{"record":{"id":"3a8a91402e171bb4","repo":"alexreisner/geocoder","slug":"please-specify-a-valid-lookup-for-geocoder-name-inspect-is","errorCode":null,"errorMessage":"Please specify a valid lookup for Geocoder (#{name.inspect} is not one of: #{valids}).","messagePattern":"Please specify a valid lookup for Geocoder \\(#(.+?) is not one of: #(.+?)\\)\\.","errorType":"exception","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"lib/geocoder/lookup.rb","lineNumber":130,"sourceCode":"    def get(name)\n      @services = {} unless defined?(@services)\n      @services[name] = spawn(name) unless @services.include?(name)\n      @services[name]\n    end\n\n\n    private # -----------------------------------------------------------------\n\n    ##\n    # Spawn a Lookup of the given name.\n    #\n    def spawn(name)\n      if all_services.include?(name)\n        name = name.to_s\n        instantiate_lookup(name)\n      else\n        valids = all_services.map(&:inspect).join(\", \")\n        raise ConfigurationError, \"Please specify a valid lookup for Geocoder \" +\n          \"(#{name.inspect} is not one of: #{valids}).\"\n      end\n    end\n\n    ##\n    # Convert an \"underscore\" version of a name into a \"class\" version.\n    #\n    def classify_name(filename)\n      filename.to_s.split(\"_\").map{ |i| i[0...1].upcase + i[1..-1] }.join\n    end\n\n    ##\n    # Safely instantiate Lookup\n    #\n    def instantiate_lookup(name)\n      class_name = classify_name(name)\n      begin\n        Geocoder::Lookup.const_get(class_name, inherit=false)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/alexreisner/geocoder/blob/c10bd701215110ebe65da1c8b8b410b124208fd2/lib/geocoder/lookup.rb#L112-L148","documentation":"Raised by Geocoder::Lookup.spawn when Geocoder.get(name) is asked for a lookup service whose name is not in all_services. It is a generic validation guard at the factory entry point: any symbol or string (e.g. Geocoder.lookup(:foo) or Geocoder::Lookup.get(:missing)) that does not match a registered lookup class fails here before any instantiation is attempted.","triggerScenarios":"Geocoder.configure(lookup: :gogle) (typo), calling Geocoder.lookup(:nonexistent), or using a lookup that requires an optional gem/require that was never loaded so it is not registered.","commonSituations":"Typos in lookup names, forgetting to require 'geocoder/lookups/...' for less common services, or upgrading Geocoder where a lookup was renamed or removed.","solutions":["Use a valid lookup name (e.g. :google, :here, :nominatim, :maxmind_local)","Check Geocoder::Lookup.all_services for the exact list on your version","Require any optional lookup files needed to register the service","Pin/verify the Geocoder version supports the lookup you want"],"exampleFix":"// before\nGeocoder.configure(lookup: :googlemaps)\n// after\nGeocoder.configure(lookup: :google)","handlingStrategy":"validation","validationCode":"raise unless Geocoder::Lookup.all_services.include?(:google)","typeGuard":"def known_lookup?(name); Geocoder::Lookup.all_services.include?(name); end","tryCatchPattern":"begin\n  Geocoder.search(q)\nrescue Geocoder::ConfigurationError\n  Geocoder.configure(lookup: :nominatim)\nend","preventionTips":["Copy lookup names from the docs/Geocoder::Lookup.all_services","Validate config at application boot","Watch for renamed lookups when upgrading geocoder"],"tags":["ruby","configuration","lookup"],"backgroundTag":"invalid-enum-value","analyzedSha":"c10bd701215110ebe65da1c8b8b410b124208fd2","analyzedAt":"2026-09-15T23:43:32.125Z","contentChangedAt":"2026-09-15T23:43:32.125Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}