尝试设置Padrino web框架,以便使用以下信息连接到本地PostgreSQL数据库:
数据库
List of databases
| Name | Owner
|------------------------|------------
| postgres | postgres
| template0 | postgres
| template1 | postgres
|trustmob_ui_development | postgres
|trustmob_ui_production | postgres
|trustmob_ui_test | postgres
(6 rows)config/database.rb https://gist.github.com/1046031
ActiveRecord::Base.configurations[:development] = {
:adapter => 'postgresql',
:host => 'localhost',
:port => '5432',
:database => 'trustmob_ui_development',
:username => 'postgres',
:password => ''
}当我尝试运行padrino rake ar:migrate时,我会得到以下错误。这里的全错误要点:https://gist.github.com/1046044
rake aborted!
ActiveRecord::ConnectionNotEstablished
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/.... 不知道我做错了什么。如何让Padrino查看/与数据库对话?
丹
发布于 2012-07-01 19:55:57
你给ActiveRecord::Base.establish_connection打过电话了吗?
发布于 2011-06-25 08:16:03
您能用代码连接Navicat或其他程序吗?
配置正确吗?通过postgresql.conf检查您的设置
https://stackoverflow.com/questions/6475452
复制相似问题