Can't find the libpq-fe.h

作者: 云中布衣   分类:  操作系统    热度: (1503℃)   时间: 2015-10-15 0:41   标签: #ruby  #gem  #rails    

Can't find the 'libpq-fe.h header when trying to install pg gem


billcode@billcode-y470:~/github/course/rottenpotatoes-rails-intro$ bundle install
Fetching source index from
Resolving dependencies.....................
Using rake 10.4.2
Using ZenTest 4.11.0
Using multi_json 1.11.2
Using jbuilder 2.3.1
Using jquery-rails 4.0.4
Installing pg 0.18.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    /home/billcode/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20151015-13282-1w5iynx.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
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:

extconf failed, exit code 1
Gem files will remain installed in /home/billcode/.rvm/gems/ruby-2.2.2/gems/pg-0.18.2 for inspection.
Results logged to /home/billcode/.rvm/gems/ruby-2.2.2/extensions/x86-linux/2.2.0/pg-0.18.2/gem_make.out
An error occurred while installing pg (0.18.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.2'` succeeds before bundling.


系统少东西了尝试先安装 libpq-dev,在运行bundle install :
  • for Ubuntu systems: sudo apt-get install libpq-dev
  • on RHEL systems: yum install postgresql-devel
  • for Mac: brew install postgresql




© 云中布衣 2015-2019 | Driven by EMLOG  | SiteMap | RunTime: 13.53ms&RSS  |   | TOP

文章数量【288】 评论数量【396】 稳定运行【1765天】

Visitor IP Address【】