【发布时间】:2019-04-22 05:08:16
【问题描述】:
我想使用以下形式的连接字符串连接到 postgresql 数据库
host=localhost user=x password=y dbname=z
这在传递给 psql 时工作正常
$ psql "host=localhost user=x password=y dbname=z"
当传递给PG gem时
> PG.connect("host=localhost user=x password=y dbname=z")
但是当我尝试将它传递给续集时它失败了
> Sequel.postgres(constr)
Sequel::DatabaseConnectionError: PG::ConnectionBad: could not connect to server: No such file or directory
如何使 sequel 连接到我的数据库?
【问题讨论】:
-
你的应用是 Rails 应用吗?
-
花见和葡萄的组合如果有帮助的话
标签: ruby postgresql sequel