【问题标题】:ActiveRecord::ConnectionNotEstablished with PostgreSQL 9.1.3 and RoR 3.2.5ActiveRecord::ConnectionNotEstablished 与 PostgreSQL 9.1.3 和 RoR 3.2.5
【发布时间】:2012-06-04 14:16:44
【问题描述】:

我刚刚用自制软件安装了 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}) 连接到数据库并且我看到了数据库。

我正在做 Ruby on Rails 教程中的 example3

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

提前谢谢各位!

【问题讨论】:

    标签: ruby-on-rails macos postgresql homebrew


    【解决方案1】:

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

    【讨论】:

    • 恭喜修复!如果可以,请确保将您的答案标记为“已接受”,以便其他人能够从您的成功中学习。干杯~
    • 哎呀..对不起,我是新来的!下次我会记住的!干杯
    猜你喜欢
    • 1970-01-01
    • 2012-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 2013-08-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多