如何在Rails 4中获取mongo映射器以生成config/mongo.yml文件 [英] How can I get mongo mapper to generate the config/mongo.yml file in Rails 4

查看:73
本文介绍了如何在Rails 4中获取mongo映射器以生成config/mongo.yml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Mongo Mapper宝石来制作Rails应用程序.我正在遵循Mongo Mapper文档中的说明.

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

以下是链接: Mongo Mapper文档

首先,我生成了一个新的Rails 4应用程序,不包括activerecord.

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

rails new my_app --skip-active-record

下一步,我添加了宝石'mongo_mapper'和宝石'bson_ext',然后将其捆绑在一起.

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

下一步是生成config/mongo.yml文件.

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

当我尝试运行命令时:

script/rails generate mongo_mapper:config

我收到此错误:

Could not find generator mongo_mapper:config.

目前没有有关在Rails 4上安装Mongo Mapper的信息,并且我不确定是否遗漏了从Rails 3变为4的东西.

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.

如何获取mongo映射器以生成config/mongo.yml文件?

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

推荐答案

我不得不更改我的Gemfile,以使用Mongo Mapper gem的Beta版来添加对Rails 4的支持.这是更新的Gemfile.

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"

这篇关于如何在Rails 4中获取mongo映射器以生成config/mongo.yml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆