我刚刚在Debian Squeeze服务器上安装了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之前,请尝试安装所有这些
或者,如果所有的lib都已安装,但仍然出现相同的错误,请尝试安装gem,并使用上面显示的错误--with-pg-config
命令指定postgres配置文件。
gem install pg --with-pg-config=TYPE_HERE_YOUR_postgresql.conf_PATH