Skip to content

fig rails example doesnt work. #63

Closed

Description

@jtoy

the postgresql database doesn't seem to start, nothing can connect:

fig run web rake db:create
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?

Also tried:
fig run db /usr/bin/psql -l
psql: 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"?

and

fig run db /usr/bin/psql -h 127.0.0.1
psql: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

Activity

  1. aanand commented on Jan 29, 2014

    @aanand

    The error message in the first case suggests that one of the following is true:

    1. your database.yml doesn't have the code to read the environment variables in it (as per the database.yml in the Rails guide)
    2. the web service isn't linked to the db service (as per the fig.yml in the same guide)
    3. the db service isn't running

    If it's (3), run fig up -d db to start the database first, then if you've done the first two, fig run web rake db:create ought to work. After that you can just run fig up to get going.

    Hope that helps!

  2. jtoy commented on Jan 29, 2014

    @jtoy
    Author

    I was reading the tutorial while you guys were updating it, fixed.
    These should be changed from:
    MY_APP_DB_1_PORT_5432_TCP_ADDR
    MY_APP_DB_1_PORT_5432_TCP_PORT

    TO:
    DB_1_PORT_5432_TCP_ADDR
    DB_1_PORT_5432_TCP_PORT

  3. added a commit that references this issue on Jan 19, 2017
  4. added a commit that references this issue on Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions