简体   繁体   English

在OS X El Capitan更新后无法捆绑安装pg gem

[英]Unable to bundle install pg gem after OS X El Capitan Update

After trying bundle install and directly using `sudo gem install pg -v "0.18.4"' I keep running into errors while trying to install the pg gem. 尝试bundle install并直接使用`sudo gem install pg -v“ 0.18.4”'之后,在尝试安装pg gem时,我一直遇到错误。 All of my gems had been running perfectly until I had installed the latest update for OS X El Capitan. 在安装了OS X El Capitan的最新更新之前,我所有的宝石都运行良好。 The error I get is as follows: 我得到的错误如下:

sudo gem install pg -v '0.18.4'
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.0.0/gems/pg-0.18.4/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160502-32186-1wkopvv.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --with-pg
    --without-pg
    --enable-windows-cross
    --disable-windows-cross
    --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}/
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/pg-0.18.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/pg-0.18.4 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/pg-0.18.4/gem_make.out

I'm awfully lost as to how to fix this... 我对如何解决这个问题感到迷茫...

I believe the issue can be fixed if you install postgresql on your system. 我相信如果您在系统上安装postgresql,则可以解决此问题。 I had a similar error the other day and it was fixed by installing homebrew and running 前几天我遇到了类似的错误,并且通过安装自制程序并运行来修复了该错误

brew install postgresql

It looks like you need to install postgresql on your system. 看来您需要在系统上安装postgresql。 If you have OSX the easiest way to get started with PostgreSQL is the Postgres.app which can be found here - Postgresapp.com 如果您有OSX,最简单的PostgreSQL入门方法就是Postgres.app,可以在这里找到-Postgresapp.com

Simply click download, and you get postgres, while avoiding the command line. 只需单击下载,即可获得postgres,而无需使用命令行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM