Ruby on rails 3 使用远程Postgres数据库安装Postgres Gem PG

Ruby on rails 3 使用远程Postgres数据库安装Postgres Gem PG,ruby-on-rails-3,postgresql,rubygems,Ruby On Rails 3,Postgresql,Rubygems,我刚刚在Debian服务器上安装了Ruby 1.9和Rails 3的新版本。Rails web应用程序需要连接到远程Postgres数据库,因此我尝试安装Postgres适配器,但安装程序似乎正在查找本地PostgreSQL数据库,并且配置了不存在的数据库,因为Postgres数据库位于不同的主机上 有人能解释一下,当实际的Postgres数据库位于不同的机器上时,如何安装Postgres适配器吗 谢谢 gem1.9.1 install pg Building native extensio

我刚刚在Debian服务器上安装了Ruby 1.9和Rails 3的新版本。Rails web应用程序需要连接到远程Postgres数据库,因此我尝试安装Postgres适配器,但安装程序似乎正在查找本地PostgreSQL数据库,并且配置了不存在的数据库,因为Postgres数据库位于不同的主机上

有人能解释一下,当实际的Postgres数据库位于不同的机器上时,如何安装Postgres适配器吗

谢谢

gem1.9.1 install pg


Building native extensions.  This could take a while...
ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again   with
--with-pg-config=/path/to/pg_config


checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

您的环境中缺少库。在尝试安装
pg
gem之前,请尝试安装所有这些工具。
或者,如果libs都已安装,但仍然出现相同的错误,请尝试安装gem,使用上面显示的错误的
--with pg config
命令指定postgres配置文件

gem install pg --with-pg-config=TYPE_HERE_YOUR_postgresql.conf_PATH

是的,就是这样。apt get install libpq dev其他配置消息真的让我走错了路。这个答案没有用。您的\u postgresql.conf\u路径是什么意思?它是postgres的jdbc url吗???它意味着将文本替换为postgresql.conf位置的路径。