【问题标题】:Heroku Mongodb setupHeroku Mongodb 设置
【发布时间】:2013-09-11 07:12:35
【问题描述】:

我正在使用 Mongodb 开发 ROR 应用程序。我正在 heroku 上部署应用程序,我使用的映射器是 mongoid。
这是我的 confiq.yml

production:
 # Configure available database sessions. (required)
 sessions:
# Defines the default session. (required)
default:
  # Defines the name of the default database that Mongoid can connect to.
  # (required).
  database: app17040252
  username: heroku
  password: XYZ
  # Provides the hosts the default session can connect to. Must be an array
  # of host:port pairs. (required)
  hosts:
    - dharma.mongohq.com:10069

我没有什么疑问
1)我想在密码字段中知道-实际密码将出现还是显示mongohq提供的密码?
2) 我是否在 confiq.yml 中遗漏了任何内容>
3) ruby​​ 2.0.0 可以正常使用 mongoid 吗?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 mongodb heroku mongoid


    【解决方案1】:

    1) 密码字段应该是 mongohq 密码。当你在那里创建数据库时,你应该得到一个。

    2) 配置对我来说几乎是正确的,只是缩进有点不对劲。 default 条目必须在 sessions 条目下。

    3) mongoid 在 ruby​​ 2.0.0 上测试,在生产中一起使用没有任何问题,所以应该没问题。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-04-18
    • 1970-01-01
    • 2013-05-15
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    • 2012-12-28
    相关资源
    最近更新 更多