ruby-samples
ruby-samples copied to clipboard
Ruby Google Sheets API Quickstart - authorize step fails
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
Steps to Reproduce the Problem
- Follow the instructions written at Google Sheets API Docs to setup the project.
- run
ruby quickstart.rb
- Allow access to the app via the browser
- 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.