I am using Omniauth and forcing /auth/facebook to display in a popup (with JS). [Instead of a new window - which is much less user friendly]
The problem is: Omniauth
If you're using heroku, then use this option:
config.omniauth :facebook, ENV['FB_APP_ID'], ENV['FB_APP_SECRET'], {:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}, :display => 'popup' }