我正在尝试使用以下代码使用Google地方调用检索到的第一页结果中的下一页令牌:
def pins_in_area
@client = GooglePlaces::Client.new('api_key_XXXXX')
@results = @client.spots(params[:lat], params[:long], :radius => params[:radius])
puts @results
next_page_token = @results.last.nextpagetoken
puts next_page_token #spots_by_pagetoken
next_spots = @client.spots_by_pagetoken(next_page_token)
puts next_spots
... 端
但是,我遇到以下错误,不确定原因:
Completed 500 Internal Server Error in 258ms (ActiveRecord: 0.0ms)
GooglePlaces::InvalidRequestError (GooglePlaces::InvalidRequestError):
app/controllers/api/v1/pins_controller.rb:89:in `pins_in_area'
Rendered /usr/local/rvm/gems/ruby-2.2.1/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (13.1ms)
Rendered /usr/local/rvm/gems/ruby-2.2.1/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (35.1ms)
Rendered /usr/local/rvm/gems/ruby-2.2.1/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (2.0ms)
Rendered /usr/local/rvm/gems/ruby-2.2.1/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (101.1ms)