【问题标题】:Error Compiling Postgres pg gem on Ubuntu 12.04 [duplicate]在 Ubuntu 12.04 上编译 Postgres pg gem 时出错 [重复]
【发布时间】:2013-01-17 20:43:38
【问题描述】:

可能重复:
Unable to install pg gem on ubuntu - Can’t find the 'libpq-fe.h header

这是尝试执行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。请问有什么问题吗

【问题讨论】:

    标签: ruby postgresql rubygems ubuntu-12.04 pg


    【解决方案1】:

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

    sudo apt-get install libpq-dev
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-30
      • 2014-04-17
      • 2014-12-05
      • 2012-07-11
      • 1970-01-01
      • 2012-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多