使用'捆绑安装'安装pg Gem时出错。无法构建本机扩展

时间:2016-05-09 17:28:45

标签: ruby postgresql rubygems bundle pg

当我运行bundle install时,它会给出:

    Installing pg 0.18.4 with native extensions

    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin
    Using config values from /Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin
    sh: /Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin: No such file or directory
    sh: /Applications/Postgres.app/Contents/Versions/latest/bin:/Users/ramishshahzad/.rbenv/shims:/Users/ramishshahzad/.rbenv/shims:/Applications/Postgres.app/Contents/Versions/9.5/bin:/Applications/Postgres.app/Contents/Versions/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin/sbin: No such file or directory
    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
      --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


    Gem files will remain installed in /var/folders/6m/cn4bddqx4yz3jgl54hwccscc0000gn/T/bundler20160509-18530-6yu7yypg-0.18.4/gems/pg-0.18.4 for inspection.
    Results logged to /var/folders/6m/cn4bddqx4yz3jgl54hwccscc0000gn/T/bundler20160509-18530-6yu7yypg-0.18.4/gems/pg-0.18.4/ext/gem_make.out
    Using rack 1.6.4
    Using tilt 2.0.1
    Using bundler 1.11.2
    Using tzinfo 1.2.2
    Using ripl 0.7.1
    An error occurred while installing pg (0.18.4), and Bundler cannot continue.
    Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.

我已经运行了gem install pg -v' 0.18.4'它安装成功: 但是,当我运行'捆绑安装'再次,它给出了同样的错误。 我运行postgresql并运行brew更新,但仍然面临错误。

0 个答案:

没有答案