0

i'm new to ruby on rails, i'm trying to run an app with postgres database, but it didn't work, i have tried to search lots of information, but i wasn't useful, Someone posted the exactly same question here Problems with rails server , I tried to use command rails new blog it created an app with sqlite3 database, it works fine, but i created app with command rails new myapp --database=postgresql after that i visit localhost page, it ocurred the exactly same 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"?

Can anyone help? it would be very much appreciated.

database.yml file information:

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

development:
  <<: *default
  database: myapp_development

test:
  <<: *default
  database: myapp_test

production:
  <<: *default
  database: myapp_production
  username: myapp
  password: <%= ENV['MYAPP_DATABASE_PASSWORD'] %>
10
  • Can you include your config/database.yml file in your question please? Commented Aug 21, 2014 at 7:51
  • Hello, i have just included the yml file, Thank you very much Commented Aug 21, 2014 at 7:58
  • please include pg_hba.conf Commented Aug 21, 2014 at 8:00
  • Did you check your db is actually running on it's default port? Also what environment you're currently running the app in? Commented Aug 21, 2014 at 8:00
  • Hello, i'm a beginner,I couldn't find pg_hba.conf. I am running it on my local MAC OS 10.9.4 ,Thank you guys. Commented Aug 21, 2014 at 8:08

1 Answer 1

0

Delete this file:

/usr/local/var/postgres/postmaster.pid

Original Answer: psql: could not connect to server: No such file or directory (Mac OS X)

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

1 Comment

Thanks for Answering this question, i think your comment inspired my to solve the issue, It's related. Here is the link i followed up with, i reinstalled home-brew and Postges moncefbelyamani.com/…

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.