ruby-samples icon indicating copy to clipboard operation
ruby-samples copied to clipboard

Ruby Google Sheets API Quickstart - authorize step fails

Open jakebills1 opened this issue 4 years ago • 0 comments

Expected Behavior

After allowing the app to access my account via the browser, I can paste the code displayed in the browser into the prompt and be authenticated.

Actual Behavior

After allowing access, pasting the code into the terminal, and pressing enter, an error is returned Screen Shot 2020-09-13 at 2 18 53 PM

Steps to Reproduce the Problem

  1. Follow the instructions written at Google Sheets API Docs to setup the project.
  2. run ruby quickstart.rb
  3. Allow access to the app via the browser
  4. paste the auth code from the browser to the terminal. The error is returned at this step.

Specifications

  • Ruby version (ruby -v) : Ruby 2.7.1
  • OS (Mac/Linux/Windows) : Mac

Changing sheets/quickstart/quickstart.rb:31 to:

  code = gets.strip

fixes the problem and allows me to successfully authenticate the quickstart app.

jakebills1 avatar Sep 13 '20 20:09 jakebills1