当数据库位于不同的服务器上时安装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-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:
bundle config build.pg --without-pg_config
bundle config build.pg --without-pg_config
感谢
推荐答案
Ruby PostgreSQL接口(AKA的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屋!