I wasn't going to comment but no one has posted anything. Since your particular error message included an SSL warning, I would check if you need to explicitly require openssl and/or that your openssl setup is correct. I've had a similar problem with geocoding timing out in my application though the stack trace was a bit different. It took a long time for the Geocoding to complete (because the address was really weird for example) but the rest of my code kept going. I think the stack trace is a bug in Geokit. Since you don't have control over how fast this runs you should consider first of all doing something to reduce the number of times you're making this call, so at a bare minimum:
def full_address
@full_address ||= Geocoder.address("#{self.latlon.x}, #{self.latlon.y}")
end
You should also consider storing full_address as a calculated field since the above code will still run every time that instance of the model is accessed the first time. So getting rid of the code above and instead adding a full_address field and a before save hook:
in a migration file:
add_column :models, :full_address, :string
and in your model.rb:
before_save :geocode_address
def geocode_address
self.full_address = Geocoder.address("#{self.latlon.x}, #{self.latlon.y}") if self.changed.include?("latlon")
end
This way the call only runs when the latlon.x and latlon.y variables are updated, not every time the address is accessed.