1
我下面這個教程:https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview設計與omniauth - 谷歌 - 的oauth2寶石
我CONFIGS是:
的Gemfile:
gem 'devise', '1.5'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
devise.rb:
require 'omniauth-google-oauth2'
config.omniauth :google_oauth2, "APP_ID", "APP_SECRET", { access_type: "offline", approval_prompt: "" }
require "omniauth-facebook"
config.omniauth :facebook, "APP-ID", "APP-Secret"
但是當我啓動服務器時出現此錯誤:
/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.12/lib/active_support/dependencies.rb:242:in `require': no such file to load -- omniauth-google_oauth2 (LoadError)
它適用於Facebook,但不適用於Google Oauth2 gem。
PS:如果我刪除了「config.omniauth:google_oauth2」這一行,則服務器正常啓動。所以我認爲這是這條線。
有什麼想法?
你需要在你的'devise.rb'頂端的寶石解決這個問題? – janders223 2012-07-12 12:55:33
是的,我通過將Devise從1.5更新爲1.5.3來解決了這個問題 – Jirico 2012-07-18 01:19:52