geokit

Geokit Gem :Uninitialized Constant


so I just want to extract the longitude/latitude coordinates from a regular address(string). I went to geokit gem documentation and did precisely what was documented, yet I keep getting this error: "NameError: uninitialized constant Geokit::Geocoders::OpenSSL"

I added "geokit" to the gemfile and this:

require 'rubygems'
require 'geokit'




def get_coordinates
  @a = Geokit::Geocoders::GoogleGeocoder.geocode '140 Market St, San Francisco, CA'
  @a.ll
end

I've also tried adding this before, but to no avail. Geokit::Geocoders::GoogleGeocoder.api_key = api_key

I just want coordinates, if this isn't a viable solution, can someone recommend another geocoder. I tried the railscasts but couldn't get that to work either. Any help would be greatly appreciated thanks!


Solution

  • Add require 'openssl' before require 'geokit'.

    Geokit does not automatically include the required OpenSSL gem.