当数据库在不同的服务器上时安装 postgres gem [英] Installing postgres gem when database is on a different server
问题描述
我的数据库与应用程序位于不同的服务器上.当我运行捆绑"时,出现以下错误:
My database is on a different server to the application. When I run "bundle" I get the following error:
没有 pg_config... 无论如何都在尝试.如果构建失败,请重试与 --with-pg-config=/path/to/pg_config
No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config
如果应用服务器上没有实际安装 pg,如何设置 pg 配置路径?我也试过:
How do I set the pg config path if pg is not actually installed on the application server? I have also tried:
捆绑配置 build.pg --without-pg_config
bundle config build.pg --without-pg_config
谢谢
推荐答案
Ruby PostgreSQL 接口(又名 pg gem)只是 PostgreSQL 客户端 C 库的一个瘦包装器.您需要安装 PostgreSQL 客户端库和头文件,否则无法安装 pg gem.你不需要在你的应用服务器上安装完整的 PostgreSQL,只需要客户端开发库,这个包可能被称为libpg-dev"或libpq-dev".
The Ruby PostgreSQL interface (AKA the pg gem) is just a thin wrapper around the PostgreSQL client C libraries. You need to install the PostgreSQL client libraries and headers or you can't install the pg gem. You don't need a whole PostgreSQL installation on your app server, just the client development libraries, the package is probably called something like "libpg-dev" or "libpq-dev".
这篇关于当数据库在不同的服务器上时安装 postgres gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!