我想將我的數據庫移動到PostgreSQL,因爲我把它放在Heroku上。 關注Railscast #342。在我的Ubuntu機器上安裝PostgreSLQ及其依賴項。當我安裝它時,我認爲用戶已經創建。我在我的database.yml中使用這個用戶。它看起來像這樣:從Sqlite3移動到PostgreSQL Rails
production:
adapter: postgresql
encoding: unicode
database: dlrvbtApp1_production
pool: 5
username: jdartland
password:
development:
adapter: postgresql
encoding: unicode
database: dlrvbtApp1_development
pool: 5
username: jdartland
password:
test:
adapter: postgresql
encoding: unicode
database: dlrvbtApp1_test
pool: 5
username: jdartland
password:
安裝pg gem和taps gem。 跑了Bundle install
,與rake db:create:all
入門水龍頭senatra與taps server sqlite://db/development.sqlite3 jdartland secure
服務器啓動服務器創建的數據庫。並嘗試通過此命令將SQL拉到我的新開發數據庫。
taps pull postgres://[email protected]/dlrvbtApp1_development http://jdartland:[email protected]:5000
然後我得到這個錯誤:
Failed to connect to database:
Sequel::DatabaseConnectionError -> PG::ConnectionBad: fe_sendauth: no password supplied
我已經試了又試,創造了新的數據庫,canhing的.yml,pg_config等等,但我不能讓它開始工作。 這是我第一次使用PostgreSQL和Heroku,請給我一隻手! :)
好的愚蠢的問題.......但你說錯誤是沒有密碼設置。但是你的database.yml文件中沒有密碼? –
很好,也試過了,得到同樣的錯誤。第一次使用數據庫時,不知道如何將身份驗證傳遞給本地mashine上的tapas gem託管的本地主機sinatra數據庫。 – fynn