title: Google Auth credentials not retrieved properly on Heroku staging account
body: <p>Rather than storing a credentials file on the server, we opted to use env vars to store the required info:</p>
  
  <pre><code>GOOGLE_CLIENT_ID
  GOOGLE_CLIENT_EMAIL
  GOOGLE_ACCOUNT_TYPE
  GOOGLE_PRIVATE_KEY
  </code></pre>
  
  <p>And we're obtaining authorization for a <code>CalendarService</code> as follows:</p>
  
  <pre><code>scopes = ["https://www.googleapis.com/auth/calendar"]
  auth = ::Google::Auth.new_application_credentials(scopes)
  service = ::Google::Apis::CalendarV3::CalendarService.new
  service.authorization = auth
  service.authorization.fetch_access_token!
  </code></pre>
  
  <p>Every part of the process works locally - authorizing, fetching an access token, interacting with API, etc. When we deploy to our staging environment on Heroku, we can't get past the following error:</p>
  
  <p><code>Unable to read the credential file specified by GOOGLE_APPLICATION_CREDENTIALS: Neither PUB key nor PRIV key: nested asn1 error</code></p>
  
  <p>I had seen this error in testing so I know it can be related <em>either</em> to a missing credentials file (like the error indicates) <em>OR</em> to an invalid id, private key, or email combination (because I was accidentally replacing the private key with an invalid value). In that situation, the error message was identical.</p>
  
  <p>We have verified that all vars match the credentials used locally - what am I missing?</p>