The docs for the Google Ruby API could be much clearer. Most of the complexity is around authorization. If you’re using a service account (not tied to any particular user) for authorization, Google provides you with a JSON file that contains your credentials.

Since you don’t want to check these credentials into your VCS, you’re only option is to upload them to s3 or another cloud store and pull them when needed.

There is another way, which was documented and merged in here, but took me a while to find and get to work.

You can set up environment three environment variables:


And use these for sheets authorization like so:

auth = Google::Auth::ServiceAccountCredentials.make_creds
auth.scope = Google::Apis::SheetsV4::AUTH_SPREADSHEETS_READONLY
sheets =
sheets.authorization = auth