Rails无法识别唯一数据库

时间:2016-07-12 00:41:49

标签: ruby-on-rails database mysql2

所以我有一个标准数据库,然后是一个数据库,我使用readonly权限从第三方博客平台(ghost)访问博客。

我的database.yml看起来像这样:

staging:
  adapter: mysql2
  encoding: utf8
  database: application
  username: application
  password: XXXXXXXX
  host: 127.0.0.1
  port: 3306

staging_blog:
  adapter: mysql2
  encoding: utf8
  database: application_blog
  username: application
  password: XXXXXXXX
  host: 127.0.0.1
  port: 3306

在使用“登台”环境运行时,迁移似乎运行时没有错误,但它们显然没有针对博客数据库运行,因为该用户只能对application_blog数据库进行只读访问。

在我的unicorn.stderr.log中,我得到以下输出:

ActiveRecord::AdapterNotSpecified: 'application_blog' database is not configured. Available: ["staging", "staging_blog"]

所以我想我的问题是......什么是必须以某种方式配置应用程序博客?如何使这个博客可以拥有与staging连接完全不同的数据库模式。

1 个答案:

答案 0 :(得分:0)

您似乎还没有创建数据库&#b; application_blog'。

相关问题