2

I just started a new rails app using

rails new myapp --database=postgresql

Then I generate some static pages:

rails g controller StaticPages home about

When I started the server and visit localhost:3000/static_pages/home, the PG::Error shows up:

PG::Error

could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

I didn't change anything else

Any idea how to make postgresql work?

1
  • Your PostgreSQL server appears to be down or listening on some other port. Commented Apr 13, 2012 at 19:43

1 Answer 1

3

It looks like your postgres server is not running. Have you started it up? If you check your system processes do you see the postgres daemon running?

If you are trying to use rails + postgres, I would recommend checking out this great video by Pete Cooper.

Sign up to request clarification or add additional context in comments.

2 Comments

yeah I didn't see it running. Any idea how to start it? Thanks for the video BTW, great resource. But I'm using windows now
How you start it depends on how you installed it, but you could start by looking for a Windows server to start.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.