wyc
wyc

Reputation: 55273

Undefined local variable or method error in OmniAuth

I'm following this tutorial.

I'm stuck in Step 4:

Step 4: Creating the Login Page Let’s create our sessions controller.

Run the following code in your terminal to create a new sessions controller, and the new, create, and failure actions.

rails generate controller sessions new create failure

When I enter the command above in the terminal I get this error (after adding my Facebook's application App ID and App Secret):

/home/alex/apps/omniauth-tutorial/config/initializers/omniauth.rb:2:in block in <top (required)>': undefined local variable or method d0cdb4fe2489xxxxxxxxxxxxxxxxxxxx' for # (NameError)

(the 'x's are the rest of the numbers).

I'm using Rails 3.1.3 and this is what I have in my Gemfile:

Any suggestions to fix this?

source 'http://rubygems.org'

gem 'rails', '3.1.3'

gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-github'

Upvotes: 0

Views: 2480

Answers (1)

dbKooper
dbKooper

Reputation: 1045

You should add quotes to the values app id and secret key

config.omniauth :facebook, "APP_ID", "APP_SECRET"

Try this and restart webrick;it should work

Upvotes: 2

Related Questions