Installing the PostgreSQL gem with 'gem pq' fails with ERROR: Failed to build gem native extension

来源:互联网 发布:程序员的思维修炼 txt 编辑:程序博客网 时间:2024/05/22 12:25
gem install pg

报错

`uilding native extensions.  This could take a while...ERROR:  Error installing pg:        ERROR: Failed to build gem native extension.    /home/tusharkhatiwada/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rbchecking for pg_config... yesUsing config values from /usr/bin/pg_configYou need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.checking for libpq-fe.h... noCan't find the 'libpq-fe.h header*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack of necessarylibraries and/or headers.  Check the mkmf.log file for more details.  You mayneed 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=/home/tusharkhatiwada/.rvm/rubies/ruby-2.0.0-p247/bin/ruby        --with-pg        --without-pg        --with-pg-config        --without-pg-config        --with-pg_config        --without-pg_config        --with-pg-dir        --without-pg-dir        --with-pg-include        --without-pg-include=${pg-dir}/include        --with-pg-lib        --without-pg-lib=${pg-dir}/Gem files will remain installed in /home/tusharkhatiwada/.rvm/gems/ruby-2.0.0-p247@rails4.0.0/gems/pg-0.17.0 for inspection.Results logged to /home/tusharkhatiwada/.rvm/gems/ruby-2.0.0-p247@rails4.0.0/gems/pg-0.17.0/ext/gem_make.out
sudo apt-get install libpq-devgem install pg -- --with-pg-config= '/usr/bin/pg_config'
0 0
原创粉丝点击