rails 3.2.2 (or 3.2.1) + Postgresql 9.1.3 + Ubuntu 11.10 Connection error

前端 未结 2 415
有刺的猬
有刺的猬 2021-02-02 04:25

I am using PostgreSQL 9.1.3 (PostgreSQL 9.1.3 on x86_64-pc-linux-gnu, compiled by gcc-4.6.real (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, 64-bit) and rails either 3.2.2 or 3.2.1 on u

2条回答
  •  無奈伤痛
    2021-02-02 04:58

    I'd like to propose a slightly different approach which utilizes the file socket instead.

    By allowing your Ubuntu user access to the database, everything should work without special connection parameters.

    In the Ubuntu command line:

    createuser -U postgres your-current-ubuntu-username

    see the Manpage of createuser for details.

    In your database.yml:

    development:
      adapter: postgresql
      encoding: unicode
      database: sample-app_development
      pool: 5
      username: your-current-ubuntu-username
      password:
    

提交回复
热议问题