Devise: omniauth 2.0.x raises RuntimeError about old OmniAuth version

Created on 22 Mar 2021  ·  2Comments  ·  Source: heartcombo/devise

Pre-check

  • Do not use the issues tracker for help or support, try Stack Overflow.
  • For bugs, do a quick search and make sure the bug has not yet been reported
  • If you found a security bug, do not report it through GitHub. Please send an e-mail to [email protected] instead.
  • Finally, be nice and have fun!

Environment

  • Ruby 2.6.3
  • Rails 6.0.3.5
  • Devise 4.7.2

Current behavior

I am getting the following error when attempting to load the Rails environment after having updated to the latest gems

Failure/Error: require File.expand_path('../config/environment', __dir__)

RuntimeError:
  You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed.
# /Users/paulfriedman/.rvm/gems/ruby-2.6.3/gems/devise-4.7.3/lib/devise/omniauth.rb:12:in `<top (required)>'

the error is coming from this omniauth version check

unless OmniAuth::VERSION =~ /^1\./
  raise "You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed."
end

however the version of omniauth I am using (2.0.3) is the most recent as of 18 Feb 2021. omniauth released version 2.0.0 in January 2021 - so I expect this error to be happening for any omniauth gem 2.x.+ https://rubygems.org/gems/omniauth

Expected behavior

Actually I don't know if devise has been tested against omniauth 2.0.0 so I suppose the first fix is to update the error message for OmniAuth::VERSION 2.0.0 or greater

then the next step is to test against omniauth 2.0.x (hopefully it just works)

if it works, then ensure the check above allows 2.0.x versions
if it doesn't, update the check to note that devise doesn't work with the most recent omniauth or fix devise-omniauth to work with version 2.0.x of omniauth

Most helpful comment

Please use devise master for the time being, it has fixes that allow it to work with OmniAuth 2.0.

https://github.com/heartcombo/devise/blob/0cd72a56f984a7ff089246f87a8b259120545edd/CHANGELOG.md#unreleased

It's pending a new release for different reasons including a few things I want to tackle before, but I'll get there eventually.

Thanks!

All 2 comments

Please use devise master for the time being, it has fixes that allow it to work with OmniAuth 2.0.

https://github.com/heartcombo/devise/blob/0cd72a56f984a7ff089246f87a8b259120545edd/CHANGELOG.md#unreleased

It's pending a new release for different reasons including a few things I want to tackle before, but I'll get there eventually.

Thanks!

What a fast response - thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mits87 picture mits87  ·  3Comments

cheung-chifung picture cheung-chifung  ·  4Comments

spaquet picture spaquet  ·  3Comments

neohunter picture neohunter  ·  3Comments

Pedroknoll picture Pedroknoll  ·  3Comments