【发布时间】:2015-01-18 05:15:57
【问题描述】:
我一直在寻找这个,但找不到解决方案。
目前我有一个 database.yml 成功连接到 Unix 套接字上的本地 pgbouncer 服务器。但是,我正在过渡到将其设置为 database_url 环境变量,并且根本无法解决如何通过 Unix 套接字连接到本地 Postgres 服务器。 localhost 显然可以正常工作。
我正在查看一个看起来像这样的 URL,显然您可以将其与 Postgres (http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html) 一起使用:
export DATABASE_URL="postgresql://username@%Fvar%Frun%Fpostgresql%F.s.PGSQL.6432/dbname"
但是,这不会通过 URI 警察:
rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/common.rb:176:in `split': bad URI(is not URI?): postgresql://username@%Fvar%Frun%Fpostgresql%F.s.PGSQL.6432/dbname
有人知道这需要什么秘方吗?我无休止地用谷歌搜索,没有找到任何东西。这一定是可能的,因为应用程序现在通过套接字连接。
提前致谢,
【问题讨论】: