googleads / google-api-ads-ruby

Ad Manager SOAP API Client Libraries for Ruby
297 stars 229 forks source link

run_saved_query': undefined local variable or method #155

Closed fontainio closed 6 years ago

fontainio commented 6 years ago

Hi I'm getting an error when i use the report service/ run_saved_query.rb

I, [2018-05-11T11:48:34.618427 #9291]  INFO -- : ID: 21633779192, URL: https://ads.google.com/apis/ads/publisher/v201802/ReportService, Service: ReportService, Action: get_saved_queries_by_statement, Response time: 134ms, Request ID: 38f82175a501e977198e6fb7d755b8e4, Is fault: false
dfp.rb:39:in `run_saved_query': undefined local variable or method `response' for main:Object (NameError)
Did you mean?  respond_to?
    from dfp.rb:82:in `<main>'
(api) dev@data:~$
donovanfm commented 6 years ago

It looks like there's a variable reference error in this example. Thanks for bringing it to our attention. Line 39 should be changed from saved_query = response[:results].first to saved_query = saved_query_page[:results].first.

My apologies for this oversight. We have a release next week, and I'll be sure to update this example in the new library version. For now, you can make the change in your local environment, and that should be all that's needed to get the example working.

donovanfm commented 6 years ago

This is now fixed in our examples.