OmniAuth with Google gives you a OAuth 400 Unauthorized Error?

If you're trying to use OmniAuth with Google and OAuth2 and keep on getting 400 Unauthorized Errors, you may need to add a scropt to your config:

  config.omniauth :google, 'CLIENTID.apps.googleusercontent.com',  'SECRET',
                  {:scope => 'https://www.google.com/m8/feeds/'}

Have been looking for hours for the correct solution. Even there is some code in the OmniAuth gem, it doesn't work correctly.