![](/img/trans.png)
[英]connection.select_value only returns strings in postgres with pg gem
[英]Postgres Gem PG Install with Remote Postgres Database
我刚刚在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之前,请尝试安装所有它们。
或者,如果所有库都已安装,而您仍然遇到相同的错误,请尝试使用--with-pg-config
命令安装指定了postgres配置文件的gem,上面显示了您的错误。
gem install pg --with-pg-config=TYPE_HERE_YOUR_postgresql.conf_PATH
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.