I want to use the Time zone gem to convert lat and long to a time zone;
- I have added the gem in to my file
- I have created
timezone.rb
inconfig/initializers
- I enabled the Google Maps Time Zone API, and added a server key
timezone.rb file:
Timezone::Lookup.config(:google) do |c|
c.api_key = 'server_key'
end
When I type to rails console;
> timezone = Timezone['America/Los_Angeles']
=> #<Timezone::Zone name: "America/Los_Angeles">
This works but when I try to use lat and long google gives connection error;
> timezone = Timezone.lookup(-34.92771808058, 138.477041423321)
Timezone::Error::Google: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed