我正試圖上傳一個rails應用程序到dotcloud。如何在Dotcloud上設置postgresql數據庫?
我得到這個錯誤:
PG::Error (could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
):
activerecord (3.2.5) lib/active_record/connection_adapters/postgresql_adapter.rb:1206:in `initialize'
我猜這是因爲我還沒有建立一個Postgres數據庫。我怎麼做?文檔似乎沒有說。
我dotcloud.yml文件看起來像這樣:
www:
type: ruby
exclude_bundler_groups:
- development
data:
type: postgresql
我的database.yml看起來是這樣的:
production:
adapter: postgresql
database: my_app_production # have not set this up on dotcloud yet as I can't find any docs on how to do it
username: root
password: mypassword
我一定要運行遷移?我該怎麼做,文件再次沒有說。
有沒有一個白癡指南在dotcloud上設置rails應用程序?我來自Heroku,您只需推送您的代碼並運行您的遷移。我花了好幾個小時與dotcloud文檔爭鬥,無法讓這個應用程序運行。
謝謝,但運行'dotcloud APPNAME.data info'不顯示數據庫的名稱。我得到一個類似於'config:postgresql_password:xyz,ports:url:pgsql:// root:[email protected]:29876,類型:postgresql'的json格式化哈希,但沒有提及db名稱。我錯過了什麼嗎? – stephenmurdoch
@stephenmurdoch你需要自己創建數據庫,並且你可以指定任何你想要的名字。來自dotcloud info命令的信息爲您提供了連接到數據庫和創建數據庫所需的信息。如果您按照此頁面上的步驟操作,它將向您展示如何創建數據庫。 http://docs.dotcloud.com/services/postgresql/ –
啊,謝謝,這很有道理,今晚我會整理一下,再次感謝。歡呼 – stephenmurdoch