intridea/omniauth-github — pull request #13 by igoodrich (2012-07-11 23:07:20+00:00)
Title: If scope is nil or 'public', skip email.

If the scope is nil or 'public', github denies access to the email and
omniauth raises a failure. This makes it so that if you want to use
github for read-only authentication, you can't (at least in an obvious
fashion).

There is a workaround: pass 'skip_info: true' on configuration. In this
case you do not get the 'nickname' and 'image', however.
For example, the following will work without this fix:
provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], skip_info:
true

The other solution, without this patch, is to specify at least the user
scope, like so:
provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'], scope:
'user'