首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >安装pg gem时找不到'libpq-fe.h头文件?

安装pg gem时找不到'libpq-fe.h头文件?

提问于 2017-12-15 14:17:46
回答 2关注 0查看 3.3K

我正在使用Ruby on Rails 3.1之前的版本。我喜欢使用PostgreSQL,但问题是安装pg gem。它给了我以下错误:

代码语言:txt
复制
代码语言:txt
复制
demonchand@system-001:~/exercise/personal/pro$ gem install pg
代码语言:txt
复制
Building native extensions.  This could take a while...
代码语言:txt
复制
ERROR:  Error installing pg:
代码语言:txt
复制
    ERROR: Failed to build gem native extension.
代码语言:txt
复制
代码语言:txt
复制
        /home/demonchand/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
代码语言:txt
复制
checking for pg_config... no
代码语言:txt
复制
No pg_config... trying anyway. If building fails, please try again with
代码语言:txt
复制
 --with-pg-config=/path/to/pg_config
代码语言:txt
复制
checking for libpq-fe.h... no
代码语言:txt
复制
Can't find the 'libpq-fe.h heade
代码语言:txt
复制
*** extconf.rb failed ***
代码语言:txt
复制
Could not create Makefile due to some reason, probably lack of
代码语言:txt
复制
necessary libraries and/or headers.  Check the mkmf.log file for more
代码语言:txt
复制
details.  You may need configuration options.
代码语言:txt
复制
代码语言:txt
复制
Provided configuration options:
代码语言:txt
复制
    --with-opt-di
代码语言:txt
复制
    --without-opt-di
代码语言:txt
复制
    --with-opt-include
代码语言:txt
复制
    --without-opt-include=${opt-dir}/include
代码语言:txt
复制
    --with-opt-lib
代码语言:txt
复制
    --without-opt-lib=${opt-dir}/lib
代码语言:txt
复制
    --with-make-prog
代码语言:txt
复制
    --without-make-prog
代码语言:txt
复制
    --srcdir=.
代码语言:txt
复制
    --curdi
代码语言:txt
复制
    --ruby=/home/demonchand/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
代码语言:txt
复制
    --with-pg
代码语言:txt
复制
    --without-pg
代码语言:txt
复制
    --with-pg-di
代码语言:txt
复制
    --without-pg-di
代码语言:txt
复制
    --with-pg-include
代码语言:txt
复制
    --without-pg-include=${pg-dir}/include
代码语言:txt
复制
    --with-pg-lib
代码语言:txt
复制
    --without-pg-lib=${pg-dir}/lib
代码语言:txt
复制
    --with-pg-config
代码语言:txt
复制
    --without-pg-config
代码语言:txt
复制
    --with-pg_config
代码语言:txt
复制
    --without-pg_config
代码语言:txt
复制
代码语言:txt
复制
代码语言:txt
复制
Gem files will remain installed in /home/demonchand/.rvm/gems/ruby-1.9.2-p0/gems/pg-0.11.0 for inspection.
代码语言:txt
复制
Results logged to /home/demonchand/.rvm/gems/ruby-1.9.2-p0/gems/pg-0.11.0/ext/gem_make.out

我如何解决这个问题?

相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档