【问题标题】:Postgresql Schema not found after moving to Amazon AWS迁移到 Amazon AWS 后未找到 Postgresql 架构
【发布时间】:2014-12-09 07:58:01
【问题描述】:

我有一个使用 postgresql 9.3.5 和公寓 gem 的多租户 rails 3.2 应用程序。在我的本地一切正常,即使我运行“rails s -e production”它仍然有效。此外,当我在 AWS 中使用“rails c production”时,它的工作原理。我可以通过 rails 控制台与数据库交互。我正在使用 VPC。我的 Rails 应用在 ec2 中,而数据库在 RDS 中。

当我部署到 AWS 时,我在浏览器中收到此错误。

Apartment::SchemaNotFound
One of the following schema(s) is invalid: ec2-54-169-xxx-xxx, "public"

乘客日志:

App 9023 stderr: Apartment::SchemaNotFound (One of the following schema(s) is invalid: ec2-54-169-xxx-xxx, "public"):
App 9023 stderr:   apartment (0.25.2) lib/apartment/adapters/postgresql_adapter.rb:92:in `rescue in connect_to_new'
App 9023 stderr:   apartment (0.25.2) lib/apartment/adapters/postgresql_adapter.rb:85:in `connect_to_new'
App 9023 stderr:   apartment (0.25.2) lib/apartment/adapters/abstract_adapter.rb:100:in `switch'
App 9023 stderr:   apartment (0.25.2) lib/apartment/elevators/generic.rb:20:in `call'

ec2-54-169-xxx-xxx 包含我的 ec2 的 ip 我只是用 x 替换了一些。

【问题讨论】:

    标签: ruby-on-rails postgresql amazon-web-services rds apartment-gem


    【解决方案1】:

    最后,我能够修复它。我正在使用 AWS 提供的公共 DNS 进行测试。看起来这是错误,因为我的应用正在监听子域。当我尝试使用 EC2 的 ip 时,它起作用了。于是我立马做Route53,在浏览器上通过域名访问,然后就可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-31
      • 2016-08-22
      • 2018-10-18
      • 2020-12-24
      • 1970-01-01
      • 1970-01-01
      • 2018-09-21
      相关资源
      最近更新 更多