How can I get mongo mapper to generate the config/mongo.yml file in Rails 4
Asked Answered
P

1

6

I am trying to make a rails app using the Mongo Mapper gem. I am following the instructions in the Mongo Mapper Documentation.

Here is the link: Mongo Mapper Docs

First, I generated a new rails 4 app excluding activerecord.

rails new my_app --skip-active-record

In the next step I added the gem 'mongo_mapper' and gem 'bson_ext' and then bundled.

The next step is generating the config/mongo.yml file.

When I try to run the command:

script/rails generate mongo_mapper:config

I get this error:

Could not find generator mongo_mapper:config.

There is currently no information on installing Mongo Mapper with Rails 4 and I am not sure if I am missing something that changed from Rails 3 to 4.

How can I get mongo mapper to generate the config/mongo.yml file?

Philosophy answered 18/9, 2013 at 18:40 Comment(0)
P
10

I had to change my Gemfile to use a beta version of the Mongo Mapper gem to add support for Rails 4. Here is the updated Gemfile.

gem 'mongo_mapper', :git => "git://github.com/mongomapper/mongomapper.git", :tag => "v0.13.0.beta2"
Philosophy answered 19/9, 2013 at 5:18 Comment(1)
This piece of code work just well. It fixed the error and the configuration file is generated by the command suggested in mongo mapper documentation.Obaza

© 2022 - 2024 — McMap. All rights reserved.