gpt4 book ai didi

ruby-on-rails - ActiveRecord::ConnectionNotEstablished 与 PostgreSQL 9.1.3 和 RoR 3.2.5

转载 作者:行者123 更新时间:2023-11-29 12:22:33 27 4
gpt4 key购买 nike

我刚刚用 Homebrew 软件安装了 PostgreSQL:

$ brew install postgresql

我安装了 pg gem:

 $ gem install pg -- --with-pg-config= '/usr/local/var/postgres/postgresql.conf'

我将应用程序的 database.yml 更改为

development:
  adapter: postgresql
  encoding: unicode
  database: rails_dev
  pool: 5
  username: vise890
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: rails_test
  pool: 5
  username: vise890
  password:

production:
  adapter: postgresql
  encoding: unicode
  database: ddb
port: 5432
  pool: 5
  username: postgres
  password: admin

但是,每当我加载任何页面时,我都会收到错误消息:

ActiveRecord::ConnectionNotEstablished

我可以使用 pgAdmin (u:vise890 P:{none}) 连接到数据库,我可以看到数据库。

我在做example3来自 Ruby on Rails 教程

如果你想检查整个事情:Sample App github branch

提前谢谢大家!

最佳答案

好吧,没关系。我从头开始,它奏效了。这是 the walkthrough如果你有兴趣

关于ruby-on-rails - ActiveRecord::ConnectionNotEstablished 与 PostgreSQL 9.1.3 和 RoR 3.2.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10882845/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com