0

I followed this guide step by step: http://railscasts.com/episodes/241-simple-omniauth

When I click the button that would take me on twitter, the result is this:

No route matches [GET] "/auth/twitter"

I made ​​several attempts, watching the video in slow motion ... but the result is always the same

Angelo Iasevoli
  • 100
  • 1
  • 6
  • Well, you need to create a route for that "path," also are you sure that whatever code you wrote generates the route for the _GET_ method? Also, it would be nice if you provided some code snippets. I honestly don't feel like watching the whole video. :( – omninonsense Jan 07 '12 at 19:07
  • do you have this in your config/routes.rb file? match "/auth/:provider/callback" => "sessions#create" – josephrider Jan 07 '12 at 19:07
  • @with a dot. - ASCIIcast search on page for "route" – josephrider Jan 07 '12 at 19:12

2 Answers2

1

You need to comment out ':omniauthable' in your model used by the Devise gem (usually it's the model 'User' = the user.rb file):

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable, :recoverable,
         :rememberable, :trackable, :validatable # plus whatever other calls...
       # :omniauthable

  [...]

end

Using the ':omniauthable' call means loading devise/omniauth components (which cause conflicts with your omniauth setup).

TomDogg
  • 3,803
  • 5
  • 33
  • 60
1

In the future, try to share your relevant code for debugging purposes. However, make sure you have the following.

In your routes, make sure you have something like

devise_for :users, :controllers => {:omniauth_callbacks => "users/omniauth_callbacks" ...

and in your, devise initializer

config.omniauth :facebook, facebook_app_id, facebook_app_secret,
     { :scope => 'yourscopeshere', :client_options => {:ssl => {:ca_path => "/etc/ssl/certs"}} }
sohaibbbhatti
  • 2,672
  • 22
  • 21