No match routes [GET] "/ auth / facebook" in ruby ​​on rails 4

I get this error when I use omniauth, rails 4.2.1. I installed gem omniauth and omniauth facebook.

routes.rb

get 'auth/:provider/callback', to: 'users#create' get 'auth/failure', to: redirect('/') get 'signout', to: 'users#destroy', as: 'signout' 

Initializers / omniauth.rb

 OmniAuth.config.logger = Rails.logger Rails.application.config.middleware.use OmniAuth::Builder do provider :facebook, 'APP_KEY', 'APP_SEC_KEY' end 

I find this error

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

Someone can help me with this, I researched and tried a lot, but nothing works.

+5
source share
1 answer

Do you use an invented stone for authentication? If so, then you use "initializers / omniauth.rb" instead, but "/initializers/devise.rb" and also "omniauthable" in the user model. Good tutorial: https://www.digitalocean.com/community/tutorials/how-to-configure-devise-and-omniauth-for-your-rails-application

+2
source

All Articles