Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 917
Kristine Jennings Avatar asked Sep 18 '13 18:09

Kristine Jennings


1 Answers

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"
like image 85
Kristine Jennings Avatar answered Sep 28 '22 07:09

Kristine Jennings