4

I am trying to configure postgreSQL as my local development database.

when I run

brew install postgres

I get the following error:

 postgresql-9.3.5 already installed

In my Gemfile I have the pg in the gem list.

When I run

rake db:create:all

I get the following error:

could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

My database.yml looks like the following:

development:
  adapter: postgresql
  encoding: unicode
  database: fls_development
  host: localhost
  pool: 5
  port: 5432

# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: postgresql
  database: fls_test
  pool: 5
  timeout: 5000

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5

also, similar to this post: How to configure PostgresSQL server on MacOS 10.8.5?, I get the following error when I just typ postgres

postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.

I am confused because the solution to the aforementioned SO post recommends installing with Homebrew however I am pretty sure that is how I installed it.

2 Answers 2

3

I have had this same issue before and have fixed it by doing this

rm /usr/local/var/postgres/postmaster.pid
brew services restart postgresql
Sign up to request clarification or add additional context in comments.

Comments

2

so, this is a sort of indirect solution, but I simply ran brew uninstall postgresql and then installed the PostgreSQL app which runs automatically on the right port 5432.

1 Comment

id rather get the answer to your original question

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.