Installing postgres gem when database is on a different server

可紊 提交于 2019-12-01 02:54:31

问题


My database is on a different server to the application. When I run "bundle" I get the following error:

No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config

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

Thanks


回答1:


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".



来源:https://stackoverflow.com/questions/12522878/installing-postgres-gem-when-database-is-on-a-different-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!