intridea/omniauth — Issue #557: StrategyNotFound
Author: feaber
Created: 2011-12-17 15:51:13+00:00
State: open

After I have added entry to 'devise.rb':

config.omniauth :google_oauth2, APP_ID, APP_SECRED...

I saw this exception:

C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/devise-1.5.2/lib/devise/omniauth/config.rb:40:in 'autoload_strategy':
Could not find a strategy with name 'GoogleOAuth2'.
Please ensure it is required or explicitly set it using the :strategy_class option. (Devise::OmniAuth::StrategyNotFound)

I investigated devise/omniauth/config.rb:

OmniAuth::Utils.camelize(provider.to_s)

and in C:\RailsInstaller\Ruby1.9.2\lib\ruby\gems\1.9.1\gems\omniauth-1.0.1\lib\omniauth.rb:

camelize() method return: GoogleOAuth2 not GoogleOauth2!

After manual modification in:

C:\RailsInstaller\Ruby1.9.2\lib\ruby\gems\1.9.1\gems\omniauth-google-oauth2-0.1.8\lib\omniauth\strategies\google_oauth2.rb
Class name from 'GoogleOauth2' to 'GoogleOAuth2' it runs without exeption

==========

I dont know if this is strategy issue or omniauth.

==========

omniauth (1.0.1)
omniauth-google-oauth2 (0.1.8)
devise (1.5.2)

Best Regards,
Konrad.