Search code examples
ruby-on-rails-3macospostgresqlpg

how do I make rails/pg/postgresql look for a different hostname/socket?


how do I make rails/pg look for psql databases at "/tmp/.s.PGSQL.5432" instead of "/var/pgsql_socket/.s.PGSQL.5432"


Solution

  • You need to add the socket option to your database.yml file.

    example:

    development:
      host: /tmp/.s.PGSQL.5432
      adapter: postgresql
      username: root
      password: password
      database: my_app_development