我是Rails和Omniauth的新手,很抱歉提前对于愚蠢的 问题。为Omniauth构建一个新的策略,但Omniauth找不到它
我正在尝试为Deezer网站做一个Omniauth策略。 http://www.deezer.com/en/developers/simpleapi/oauth
首先,我设置了一个基本的rails应用程序来测试Facebook的策略。 这是我在Github的代码: https://github.com/geoffroymontel/omniauth-test
它工作正常。好。
然后我说我的应用程序lib目录
lib/omniauth-deezer.rb
lib/omniauth/deezer.rb
lib/omniauth/deezer/version.rb
lib/omniauth/deezer/strategies/deezer.rb
这些文件和
config/initializers/omniauth.rb
添加
provider :deezer, ENV['DEEZER_APP_ID'],
ENV['DEEZER_APP_SECRET'], :perms => 'basic_access,email'
但是,当我开始
rails s
应用
我收到以下错误消息
/home/geoffroy/.rvm/gems/[email protected]/gems/omniauth-1.0.2/lib/omniauth/builder.rb:33:in `rescue in provider': Could not find matching strategy for :deezer. You may need to install an additional gem (such as omniauth-deezer). (LoadError) from /home/geoffroy/.rvm/gems/[email protected]/gems/omniauth-1.0.2/lib/omniauth/builder.rb:30:in `provider'
感谢您的帮助
最佳
弗鲁瓦
我加 需要 'omniauth-的Deezer' 在初始化/ omniauth.rb 和它的工作。 现在我不明白为什么我需要它和Facebook不,但... – geoffroy 2012-02-06 11:36:54