Search code examples
ruby-on-rails-3facebookomniauth

Rails OmniAuth NoMethodError with Facebook


I've been following this tutorial for setting up OmniAuth with facebook, however when I try to run /auth/facebook, I get an error as follows:

NoMethodError in SessionsController#create
undefined method `[]' for nil:NilClass

My code is the same as the one in the tutorial, except

auth = request.env['rack.auth']

is changed to

auth = request.env['omniauth.auth']

Solution

  • Those instructions are a bit dated. Try Railscasts instead.