Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadError: cannot load such file -- omniauth #1105

Closed
joeczucha opened this issue Mar 7, 2018 · 2 comments
Closed

LoadError: cannot load such file -- omniauth #1105

joeczucha opened this issue Mar 7, 2018 · 2 comments

Comments

@joeczucha
Copy link

joeczucha commented Mar 7, 2018

Clean install:

devise_token_auth 0.1.42 (also occurs with master branch from Github)
rails 5.1.5

When running rails s:

Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile.
rake aborted!
LoadError: cannot load such file -- omniauth
/Users/joe/Labs/authentication-test/app/models/user.rb:3:in `<class:User>'
/Users/joe/Labs/authentication-test/app/models/user.rb:1:in `<top (required)>'
/Users/joe/Labs/authentication-test/config/routes.rb:2:in `block in <top (required)>'
/Users/joe/Labs/authentication-test/config/routes.rb:1:in `<top (required)>'
/Users/joe/Labs/authentication-test/config/environment.rb:5:in `<top (required)>'
/Users/joe/.rbenv/versions/2.4.3/bin/bundle:23:in `load'
/Users/joe/.rbenv/versions/2.4.3/bin/bundle:23:in `<main>'

Seems that the generated user model includes the following modules:

devise :database_authenticatable, :registerable,
      :recoverable, :rememberable, :trackable, :validatable,
      :confirmable, :omniauthable

Whereas the default devise generated user model includes the following modules:

devise :database_authenticatable, :registerable,
      :recoverable, :rememberable, :trackable, :validatable,

Sure enough, removing :omniauthable from this list fixes this for me.

Thanks for your efforts with this gem.

@zachfeldman
Copy link
Contributor

@joeczucha glad it was fixed! You're welcome

@PierceF
Copy link

PierceF commented Feb 27, 2020

So how do you fix it without removing :omniauthable ?
EDIT: Oh I just added the omniauth gem to the gem file to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants