【问题标题】:ERROR: Failed to buil gem native extension because PostgreSQL is too old错误:由于 PostgreSQL 太旧,无法构建 gem 原生扩展
【发布时间】:2014-07-15 13:16:51
【问题描述】:

我正在尝试在 Mavericks 的 Rails 项目中运行 bundle。使用此错误访问 pg gem 时失败。

它说 你的 PostgreSQL 太旧了。安装此 gem 的旧版本或升级您的数据库。。所以我安装了postgresql-9.3.4gem install gem 但发生了同样的错误。

Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /path/to/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/local/php5/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... yes
checking for PQconnectionUsedPassword()... no
Your PostgreSQL is too old. Either install an older version of this gem or upgrade your database.
*** 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=/path/to/.rvm/rubies/ruby-2.1.1/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}/lib
    --with-pqlib
    --without-pqlib

extconf failed, exit code 1

提前致谢。

【问题讨论】:

    标签: ruby-on-rails ruby postgresql


    【解决方案1】:

    尝试将您的 postgresql 安装添加到您的路径:

    export PATH=/usr/pgsql-9.3.4/bin:$PATH
    

    【讨论】:

    • 谢谢! @Sergio A,我可以毫无问题地安装 pg gem。
    猜你喜欢
    • 2016-03-08
    • 1970-01-01
    • 2014-06-04
    • 2016-07-29
    • 1970-01-01
    • 2013-06-27
    • 1970-01-01
    • 2020-04-23
    • 2013-04-21
    相关资源
    最近更新 更多