random
random

Reputation: 10309

Deploy rails app on dotcloud

I'm trying to deploy a ruby on rails app to dotcloud. The app is deployed but when I try to access the url, I get this 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"? (PG::Error)

I'm using a postgresql database. What all changes do I need to make in the database.yml file?

I've also followed the steps outlined here: http://docs.dotcloud.com/services/postgresql/

Can anyone please help on this?

Upvotes: 1

Views: 442

Answers (1)

jpetazzo
jpetazzo

Reputation: 15501

It looks like your app is configured to use a local PostgreSQL database (local as in "running on the same machine"). You should make sure that your dotcloud.yml file contains a section for a PosgreSQL database, e.g.:

db:
  type: postgresql

Then use either dotcloud info to retrieve the host, port, and credentials of the database, or parse them from environment.json in your Ruby app.

This last step is explained in the dotCloud PostgreSQL service documentation.

Upvotes: 1

Related Questions