title: error with postgresql datababse : Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
body: <p>When I run the <code>rake db:migrate</code> or run the <code>rails s</code> command, I get the same error: </p>
  
  <pre><code>Error : 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"?
  </code></pre>
  
  <p>I get the error in the browser when I try <code>rails s</code>.</p>
  
  <p>This is my database.yml</p>
  
  <pre><code>default: &amp;default
  adapter: postgresql
  encoding: unicode
  
  pool: 5
  
  development:
  &lt;&lt;: *default
  database: books_development
  
  
  
  
  test:
  &lt;&lt;: *default
  database: books_test
  
  
  
  production:
  &lt;&lt;: *default
  database: books_production
  username: abd
  password: &lt;%= ENV['BOOKS_DATABASE_PASSWORD'] %&gt;
  </code></pre>
  
  <p>Note : I have the databases <code>books_development</code>; <code>books_test
  </code> ; and the postresql are running without problems when I try <code>sudo /etc/init.d/postgresql start</code></p>
  
  <p>I did run: </p>
  
  <pre><code>create database books_development;
  create database books_test; 
  </code></pre>
  
  <p>in the psql console. And it said that it's done successfully </p>
  
  <p>I tried a lot of solutions and I spent yesterday looking for a solution and no solution in the related questions solved my error.</p>
  
  <p>I have postgresql-9.4 (the latest) and xubuntu 14.04</p>
  
  <p>Any Ideas?</p>