質問

I am working on a Rails 4 app and would like to use MongoMapper and Devise for authentication. When I add devise to my Gemfile and bundle install it goes fine and I am able to rails g devise:install, and it picks up that I am using MongoMapper as my ORM. When I try to rails g mongo_mapper:config it says it cannot find the generator. Also I know that Devise supports Mongoid by default, but I like MongoMapper and would like to stick with that. I downgraded to Rails 3.2.14 and it seems to work fine. Any ideas on what I may be overlooking, or if Devise/MongoMapper support each other in Rails 4?

役に立ちましたか?

解決

I got also errors using the generators to create a model for the devise user.

This worked after using:

gem 'mongo_mapper', '>= 0.13.0.beta2' gem 'devise' gem 'mm-devise'

and then in the devise.rb:

require 'devise/orm/mongo_mapper'

After that I did not got into any erros.

他のヒント

gem 'mongo_mapper'
gem 'devise'
gem 'mm-devise'

and also devise.rb should be

require 'mongo_mapper'
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top