3

我尝试将用户 http 会话存储在 mongodb 中。我找到了这个不错的宝石:https ://github.com/biilmann/mongo_sessions 并尝试使用它。我得到了 Mongoid:Module 的未定义方法“master”

比我改变旧的

:collection => lambda { Mongoid.master.collection('sessions') }

到应该工作并带来会话集合的东西:

Mongoid::Sessions.default.collections.find{|i| i.name == 'sessions'}

但我得到:Moped::Collection 的未定义方法“find_one”

4

1 回答 1

2

In your Gemfile, try using the Github repository for this gem instead of the one hosted on rubygems.org. There was a pull request submitted within the last few weeks that has been merged into master, but not yet published as a gem. It looks like it might address your issue.

gem "mongo_sessions", :require => "mongo_sessions/rails_mongo_store", :git => 'git://github.com/biilmann/mongo_sessions'
于 2012-12-02T17:28:37.220 回答