Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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'] %>
share|improve this question
    
Can you include your config/database.yml file in your question please? –  Luca B. Aug 21 '14 at 7:51
    
Hello, i have just included the yml file, Thank you very much –  Snailwalker Aug 21 '14 at 7:58
    
please include pg_hba.conf –  tty6 Aug 21 '14 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? –  Luca B. Aug 21 '14 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. –  Snailwalker Aug 21 '14 at 8:08

1 Answer 1

up vote 0 down vote accepted

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)

share|improve this answer
    
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/… –  Snailwalker Aug 21 '14 at 12:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.