4

可能重复:
无法在 ubuntu 上安装 pg gem - 找不到 'libpq-fe.h 标头

这是尝试做的错误bundle install

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

        /usr/bin/ruby1.8 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.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby1.8
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config


Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.14.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.14.1/ext/gem_make.out

我正在使用 ubuntu 12.04.Can 任何一点可能是错的

4

1 回答 1

12

看起来您需要为 postgres 安装开发库:

sudo apt-get install libpq-dev
于 2013-02-02T18:37:03.647 回答