I have successfully created access tokens using the following piece of code.
client_secrets = Google::APIClient::ClientSecrets.load("#{Rails.root}/c