0
votes

So, I followed the instructions as mentioned here http://railscasts.com/episodes/235-devise-and-omniauth-revised and successfully setup the the sign in and sign up with twitter option. Now I am trying to setup facebook. Using the gem 'omniauth-facebook'. After installing it. I then added to /config/initializers/devise.rb file

config.omniauth :facebook, ENV["FB_APP_ID"], ENV["FB_SECRET_ID"]

Now, when I try to sign in with facebook. I get the error -

ArgumentError in OmniauthCallbacksController#facebook

wrong number of arguments(3 for 2)

I was doubting an error might show up. But not sure how to fix it.

My controller and user model are same as mentioned here - http://railscasts.com/episodes/235-devise-and-omniauth-revised

What am i missing?

UPDATE: I did change this in the user.rb model file

instead of alias_method :twitter, :all I made it alias_method :twitter, :facebook :all

Thanks

1

1 Answers

2
votes

This worked for me:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, 'FB_APP_ID', 'FB_SECRET_ID'

but i didn't use devise, so just try to remove the ENV .

Also read here about all the options and some fails you may encounter:

https://github.com/plataformatec/devise/wiki/OmniAuth%3a-Overview