I have a Google Service Account that my app uses to retrieve data from Google Analytics.
When I created the account I downloaded a client_secrets file with
client_secrets
I found this
require "google/cloud/bigquery" ENV["BIGQUERY_PROJECT"] = "my-project-id" ENV["BIGQUERY_CREDENTIALS"] = "path/to/keyfile.json" bigquery = Google::Cloud::Bigquery.new
more detail:
https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-bigquery/AUTHENTICATION.md