2012-06-05 45 views
0

發生問題。在Windows 7上運行PostgreSQL,Rails 3.2.3,Ruby 1.9.2p180和1.9.3(通過Pik)。當我嘗試做URI :: InvalidURIError PostgreSQL Rails 3.2.3

heroku db:push 
上紅寶石1.9.2

,我得到一個錯誤

Loaded Taps v0.3.23 
Auto-detected local database: postgres://postgres:[email protected]/prelaunch_d 
evelopment 
# Connect on a TCP socket. Omitted by default since the client uses a?encoding=u 
tf8 
..... 
Failed to connect to database: 
URI::InvalidURIError -> bad URI(is not URI?): postgres://postgres:[email protected] 
alhost/prelaunch_development 
# Connect on a TCP socket. Omitted by default since the client uses a?encoding=u 
tf8 

什麼可能我做錯了嗎?

回答

1

原來是我的database.yml文件出現問題, 使用this,它有問題。切換到this解決了問題

0

如果您在本地機器上工作,嘗試這樣的事情。

login: &login 
    adapter: postgresql 
    host: localhost 
    username: postgres 
    password: yourpassword! 
    pool: 5 
    encoding: unicode 


development: 
    database: dbname 
    <<: *login 

test: 
    database: dbname 
    <<: *login 

production: 
    database: dbname 
    <<: *login 

請注意,host:localhost是因爲默認文件沒有。

相關問題