0

I am having an issue while trying to connect with a PG database in my Rails application:

  1. I've create my new app with the following command:

    $ rails new -d postgresql myApp
    
  2. The application was created successfully. Therefore I proceed with the following command:

     $ createuser --createdb --login -P myApp
    

    The prompt asks me a password for a new role. I enter the password and re-enter it for confirmation. This the message I get after entering the password:

      createuser: could not connect to database postgres: 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"?
    

Any help? I am using PG version 9.5.3 and Ruby on Rails version 4.2.4

6
  • Is the server running locally and accepting connections on Unix domain socket ... Well, is it? GIYF Commented May 16, 2016 at 13:30
  • Did you create the database after making the app? Try running "bundle exec rake db:create" to create the database for your app and then try creating a user. Commented May 16, 2016 at 13:54
  • Possible duplicate of Postgres could not connect to server Commented May 16, 2016 at 14:07
  • What is the output of "ps auxwww | grep postgres" Commented May 16, 2016 at 15:24
  • the output is: "sandropalmieri 2663 0,0 0,0 2432772 468 s000 R+ 9:28pm 0:00.00 grep postgres" what does it mean? Commented May 16, 2016 at 19:29

0

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.