相关疑难解决方法(0)

Geocoder gem是否可以使用谷歌API密钥?

我正在为我的项目使用ruby geocoder gem,随着项目的不断发展,我开始考虑连接到Google API密钥.将此添加到项目后:

Geocoder.configure do |config|

# geocoding service (see below for supported options):
config.lookup = :google

# to use an API key:
config.api_key = 'my_key'

# geocoding service request timeout, in seconds (default 3):
config.timeout = 5

end 
Run Code Online (Sandbox Code Playgroud)

我收到Google Geocoding API错误:请求被拒绝.当我启动应用程序时.从阅读开始,如果他们选择继续使用宝石,似乎其他人转向雅虎.我可以将gem配置为使用google api密钥吗?主要是,我想留意每日查询的数量,以避免超过限制.

geocoding ruby-on-rails ruby-on-rails-3 rails-geocoder

17
推荐指数
2
解决办法
5809
查看次数