This is a working demo facebook authentication app using Ruby on Rails.
You can see a tutorial for this here
How to use:
Create your database.
Run the migrations.
bundle installto install all necessary dependencies.
omniauth.rbwith your facebook app credentials. (app id and app secret)