这是我第一次尝试使用Omniauth。当我从github测试https://github.com/pt/devise-omniauth-example这个例子时,我遇到了一个错误
.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openid/store/filesystem (LoadError)
这是我的Gemfile内容
source 'http://rubygems.org'
gem 'rake'
gem 'rails'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'devise', :git => 'git://github.com/plataformatec/devise', :branch => 'master'
gem "omniauth", "1.0.1"
gem 'paperclip'
gem "simple_form", "~> 1.5.2"
gem 'twitter_oauth', '0.4.3'
gem "rest-client", "1.6.7", :require => "restclient"
gem "sluggable"
group :development, :test do
gem 'rspec-rails'
gem 'fixjour'
end
我搜索网络但没有运气。
答案 0 :(得分:5)
答案 1 :(得分:1)
这是由于您使用的各种版本的Gems以及它们之间的依赖关系
在https://github.com/pt/devise-omniauth-example的示例中,
如果您注意到Gemfile,则有
gem 'omniauth', '0.2.0'
但在上面的Gemfile中,您正在使用
gem "omniauth", "1.0.1"
答案 2 :(得分:0)
添加gem 'ruby-openid-apps-discovery'
,并在application.rb
。
require 'omniauth-openid'
require 'openid'
require 'openid/store/filesystem'
require 'gapps_openid'