undefined method `oauth'

258 views
Skip to first unread message

Christian Fazzini

unread,
Sep 27, 2010, 3:35:46 PM9/27/10
to Devise
I am following: http://stjhimy.com/posts/14-allowing-devise-login-with-facebook-account

When I place the following in /initializers/devise.rb

config.oauth :facebook, 'actual_api_id', 'actual_api_secret',
:site => 'https://graph.facebook.com/',
:authorize_path => '/oauth/authorize',
:access_token_path => '/oauth/access_token',
:scope => %w(email)

.. and start the server (rails s)

I get: devise.rb:143:in `block in <top (required)>': undefined method
`oauth' for Devise:Module (NoMethodError)

The doc at http://github.com/plataformatec/devise/wiki/OAuth2:-Overview
says, "WARNING: THIS REQUIRES DEVISE FROM GIT REPOSITORY. " Does this
have anything to do with this?

I have the following in my gemfile:

gem 'devise'
gem 'oauth2'
gem "cancan"
gem 'friendly_id', '~> 3.1.3'
gem 'activemerchant'
gem 'paperclip'
gem 'will_paginate', '~> 3.0.pre2'

Christian Fazzini

unread,
Sep 27, 2010, 4:53:02 PM9/27/10
to Devise
Ok, had to use git source, as described in above url. Seems to work
now

On Sep 28, 3:35 am, Christian Fazzini <christian.fazz...@gmail.com>
wrote:
> I am following:http://stjhimy.com/posts/14-allowing-devise-login-with-facebook-account
>
> When I place the following in /initializers/devise.rb
>
> config.oauth :facebook, 'actual_api_id', 'actual_api_secret',
>     :site              => 'https://graph.facebook.com/',
>     :authorize_path    => '/oauth/authorize',
>     :access_token_path => '/oauth/access_token',
>     :scope             => %w(email)
>
> .. and start the server (rails s)
>
> I get: devise.rb:143:in `block in <top (required)>': undefined method
> `oauth' for Devise:Module (NoMethodError)
>
> The doc athttp://github.com/plataformatec/devise/wiki/OAuth2:-Overview

Kiran Narasareddy

unread,
Oct 4, 2010, 2:22:10 AM10/4/10
to Devise
Hey,
I am facing the same problem, as you said i tried installing it from
git source, but it is not working.
my environment.rb includes the following lines :

config.gem 'warden', :git => "http://github.com/hassox/warden.git"
config.gem 'devise', :git => "http://github.com/plataformatec/
devise.git", :version => '1.0.8'
config.gem 'oauth2'
config.action_mailer.default_url_options = { :host => 'localhost:
3000' }

I am using rails 2.3.8

phil

unread,
Oct 17, 2010, 8:07:36 AM10/17/10
to Devise
I get this too using the master branch, which claims to have oauth...

I am also unclear if we are supposed to be moving away from oauth to
omniauth!

On Oct 4, 8:22 am, Kiran Narasareddy <kiran.narasare...@gmail.com>
wrote:

José Valim

unread,
Oct 17, 2010, 9:21:10 AM10/17/10
to Devise
OAuth is only on master branch. By specifying version 1.0.8, you are
using earlier branches.

On Oct 4, 8:22 am, Kiran Narasareddy <kiran.narasare...@gmail.com>
wrote:

José Valim

unread,
Oct 17, 2010, 9:21:29 AM10/17/10
to Devise
In other words, you cannot use the oauth bit with Rails 2.3.8.

On Oct 4, 8:22 am, Kiran Narasareddy <kiran.narasare...@gmail.com>
wrote:

José Valim

unread,
Oct 17, 2010, 9:21:58 AM10/17/10
to Devise
If you are starting now, I would recommend you to use the omniauth
branch, check the omniauth railscasts with Devise and the omniauth
documentation in the wiki.
Reply all
Reply to author
Forward
0 new messages