2011-06-25 68 views
1

試圖安裝的Padrino web框架與下面的信息連接到我的本地PostgreSQL數據庫:不能Padrino連接到PostgreSQL數據庫W/ActiveRecord的

數據庫

 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) 

配置/ 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看到/與數據庫交談?

〜Dan

回答

0

您可以使用Navicat或其他程序與您的代碼連接嗎?

配置是否正確?檢查您的設置通過postgresql.conf

1

你有沒有在任何地方調用ActiveRecord :: Base.establish_connection?