Skalar / google_distance_matrix

Ruby client for The Google Distance Matrix API.
MIT License
58 stars 45 forks source link

Invalid google_api_key configuration #50

Closed Insidexa closed 4 years ago

Insidexa commented 4 years ago
GoogleDistanceMatrix.configure_defaults do |config|
  config.protocol = "https"
  config.google_api_key = "API KEY"
  puts config.class
  puts config.methods
end

I got next error

Unable to load application: NoMethodError: undefined method `google_api_key=' for #<GoogleDistanceMatrix::Configuration>

/home/app/appName/config/initializers/matrixapi.rb:3:in `block in <top (required)>': undefined method `google_api_key=' for #<GoogleDistanceMatrix::Configuration> (NoMethodError

Output with | grep google

puts config.class
puts config.methods
google_business_api_client_id
google_business_api_client_id=
google_business_api_private_key
google_business_api_private_key=

Not exists google_api_key

thhermansen commented 4 years ago

Hmm, which version of google distance matrix are you on?

This is a test I did now:

gem list | grep google_distance_matrix
google_distance_matrix (0.6.2)
irb
irb(main):001:0> require 'google_distance_matrix'
=> true
irb(main):002:0> GoogleDistanceMatrix.configure_defaults { |conf| conf.google_api_key = "API KEY" }
=> "API KEY"
irb(main):003:0>

At least it seems ok for me.

Insidexa commented 4 years ago

@thhermansen Ohh, I try to migrate site but not check library version, sorry Thank you ( I am not ruby developer )

thhermansen commented 4 years ago

No problem :-)