我希望在Koala的帮助下将facebook登录集成到rails项目上的ruby。我按照http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/指定的教程链接进行了操作。但是在安装了考拉宝石后,它没有显示捆绑列表。甚至如果我运行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'
答案 0 :(得分:0)
我通过评论
来解决这个问题config.action_controller.allow_forgery_protection = false
config.gem "koala"
来自我的config / environment.rb文件
但是现在当我点击使用facebook链接登录oauth时,我从Devise那里得到“Csrf detected”错误。
你有这个工作吗?