解决方法
根据
gem documentation on Github,您可以在测试中使用测试查找,以避免执行实际请求:
Geocoder.configure(:lookup => :test) Geocoder::Lookup::Test.add_stub( "New York,NY",[ { 'latitude' => 40.7143528,'longitude' => -74.0059731,'address' => 'New York,NY,USA','state' => 'New York','state_code' => 'NY','country' => 'United States','country_code' => 'US' } ] )