-
Notifications
You must be signed in to change notification settings - Fork 240
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
Q: Getting NoAdapterAvailableError? (R: Check the declarations order in your Gemfile!) #158
Comments
Hello @emirkin, I think I know what's going on: does # Gemfile
gem 'mongoid', '~> 4.0'
gem 'simple_token_authentication', '~> 1.0' Why? When you start your Rails app, the dependencies are required by Bundler, which loads them in the same order they are declared in the # config/application.rb
# Requiring 'mongoid' at this point would solve the issue too,
# but you don't want to do that if you can swap the gems in you Gemfile.
Bundler.require(*Rails.groups)
# ... Simple Token Authentication in fact does not depend on Mongoid (you could be using Active Record) and Bundler has no reason to load them in any specific order, which is sad because by design the Please confirm to me that swapping does the trick! |
Ha! I have just discovered just that. I wish I've seen your note yesterday :-) |
@gonzalo-bulnes , can I ask you 2 questions while I have your attention?
Thanks much! |
Hi @emirkin, All questions are welcome! That being said, I'd prefer to continue the discussion in the corresponding issues to keep one topic per issue, I give you the pointers here (and, by the way, I'll edit this issue title to make is easier to find):
About backward compatibility with the deprecated Devise token authentication behaviour: please note that providing the user email (or any kind of identifier - see the identifiers option) is mandatory for security reasons (more in this gist). That was not part of the Devise strategy behaviour I think, so full backward compatibility is not possible anyway unless I'm wrong. It's for the better! Regards! |
I am getting
SimpleTokenAuthentication::NoAdapterAvailableError
with Mongo 4.0.2The text was updated successfully, but these errors were encountered: