使用Google Oauth2的Omniauth会出现加载错误

时间:2013-07-25 10:57:13

标签: ruby-on-rails ruby-on-rails-3 omniauth google-oauth

只需将gem包含在我的Gemfile中:

gem 'omniauth-google-oauth2'

我收到以下错误:

21:20:05 web.1  | started with pid 20590
21:20:14 web.1  | /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:74:in `require': cannot load such file -- omniauth/google/oauth2 (LoadError)
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:74:in `rescue in block in require'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:62:in `block in require'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
21:20:14 web.1  |   from /Users/user/Sites/WISDOM/code/git/wisdom/config/application.rb:7:in `<top (required)>'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.11/lib/rails/commands.rb:53:in `require'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.11/lib/rails/commands.rb:53:in `block in <top (required)>'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
21:20:14 web.1  |   from /Users/user/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
21:20:14 web.1  |   from script/rails:6:in `require'
21:20:14 web.1  |   from script/rails:6:in `<main>'
21:20:14 web.1  | exited with code 1
21:20:14 system | sending SIGTERM to all processes
SIGTERM received

我使用以下宝石:

oauth2 (0.9.2)
rails (3.2.11)
devise (3.0.0)

我见过这个问题 https://github.com/zquestz/omniauth-google-oauth2/pull/32 但在这种情况下,升级设计并没有帮助。

知道可能是什么问题吗?

1 个答案:

答案 0 :(得分:4)

我将Oauth2与Devise一起使用,并在我的gemfile中以下列方式包含omniauth-google-oauth2:

gem'omniauth-google-oauth2',git:'https://github.com/zquestz/omniauth-google-oauth2.git'