I\'m building a rails app that pulls data from Google Analytics using the Google Api Client Library for Ruby.
I\'m using OAuth2 and can get everything working in dev
As discussed in this thread, rather than supplying a path to a json key file you can set three ENV variables instead:
GOOGLE_ACCOUNT_TYPE=service_account GOOGLE_PRIVATE_KEY=XXX GOOGLE_CLIENT_EMAIL=XXX
Source here.