0
我正在嘗試使用gmail和OmniAuth在rails 3中登錄。我正在關注http://hoisie.com/2011/09/12/using-google-oauth-with-omniauth/此主題。我在我的gem文件中添加了gem 'omniauth'
。在初始化器中創建omniauth.rb。通過在google api網站中生成的API密鑰替換oauth_secret
。在rails 3中使用gmail和OmniAuth登錄
創建會話控制器和添加
match "/auth/:provider/callback" => "sessions#create"
match "/signout" => "sessions#destroy", :as => :signout
這在我的route.rb
當我運行應用程序收到下面的錯誤。
/usr/lib/ruby/gems/1.8/gems/omniauth-1.0.1/lib/omniauth/builder.rb:25:in `provider': Could not find matching strategy for :google. You may need to install an additional gem (such as omniauth-google). (LoadError)