0

我想在 Koala 的帮助下将 facebook 登录集成到 ruby​​ on rails 项目。我遵循了http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/指定的教程链接。但是在安装了 koala gem 之后,它没有显示捆绑列表。即使我运行 rails 服务器,它也会给我以下类型的错误消息:

C:/sample/facebook/config/initializers/koala.rb:10:in `<top (required)>': uninitialized constant Koala (NameError)
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:556:in `block (2 levels) in <class:Engine>'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:555:in `each'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:555:in `block in <class:Engine>'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from C:/sample/facebook/config/environment.rb:5:in `<top (required)>'
        from C:/sample/facebook/config.ru:4:in `require'
4

1 回答 1

0

我通过注释掉

config.action_controller.allow_forgery_protection = false
config.gem "koala"

从我的 config/environment.rb 文件

但是现在当我点击 oauth 的 facebook 链接登录时,我从 Devise 收到“检测到 Csrf”错误。

你得到这个工作了吗?

于 2012-07-10T00:57:18.173 回答