我有rails 2.3.8应用程序
我的gemfile中有pg,但在部署后显示错误

servers: ["apphost"]
    [apphost] executing command
 ** [out :: apphost] Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
 ** [out :: apphost]
 ** [out :: apphost] /usr/local/bin/ruby extconf.rb
 ** [out :: apphost] checking for pg_config... no
 ** [out :: apphost] No pg_config... trying anyway. If building fails, please try again with
 ** [out :: apphost] --with-pg-config=/path/to/pg_config
 ** [out :: apphost] checking for libpq-fe.h... no
 ** [out :: apphost] Can't find the 'libpq-fe.h header
 ** [out :: apphost] *** extconf.rb failed ***
 ** [out :: apphost] Could not create Makefile due to some reason, probably lack of
 ** [out :: apphost] necessary libraries and/or headers.  Check the mkmf.log file for more
 ** [out :: apphost] details.  You may need configuration options.
 ** [out :: apphost]
 ** [out :: apphost] Provided configuration options:

最佳答案

通过分析日志,Gem找不到pg config,postgres尚未安装在该服务器上,或者您需要正确配置路径。

10-06 03:52