1

Trying to setup the Padrino web framework to connect to my local PostgreSQL database with the following info:

databases

       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  => ''
}

When I try to run padrino rake ar:migrate I get the following error. Full error Gist here: https://gist.github.com/1046044

rake aborted!
ActiveRecord::ConnectionNotEstablished
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/.... 

Not sure what I'm doing wrong. How do I get Padrino to see/talk to the databases?

~Dan

Community
  • 1
  • 1
thoughtpunch
  • 1,907
  • 4
  • 25
  • 41

2 Answers2

1

Have you call ActiveRecord::Base.establish_connection anywhere?

Max
  • 2,063
  • 2
  • 17
  • 16
0

Can you connect with Navicat or other programs with your code?

The config is correct? Check your settings through postgresql.conf

DAddYE
  • 1,719
  • 11
  • 16