首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pg安装失败

pg安装失败
EN

Stack Overflow用户
提问于 2017-04-25 13:56:01
回答 2查看 1.7K关注 0票数 2

CentOS6.9(类似于问题:Can't find the PostgreSQL client library (libpq),但那是在MacOS上,而不是Centos上,所以这些解决方案不起作用

ruby 2.1.8 (尝试2.2)

rails 4.2.6 (尝试5.0)

postgres 9.3

我正在尝试安装pg gem:

代码语言:javascript
复制
gem install pg -- --with-pqlib=/usr/lib64/libpqxx-4.0.so --with-pg-config=/usr/pgsql-9.3/bin/pg_config

我一直试图给它提供不同的库,但是它被困住的是一些PQconnectdb()函数。以下错误

Rails过去是用pg安装在这台计算机上的,但是在更新之后发生了一些事情。这里有什么想法吗?

代码语言:javascript
复制
ERROR:  Error installing pg:
ERROR: Failed to build gem native extension.

current directory: /home/myusername/.rvm/gems/ruby-2.1.8/gems/pg-0.14.1/ext
/home/myusername/.rvm/rubies/ruby-2.1.8/bin/ruby -r ./siteconf20170425-12873-191077o.rb extconf.rb --with-pqlib=/usr/lib64/libpqxx-4.0.so --with-pg-config=/usr/pgsql-9.3/bin/pg_config
Using config values from /usr/pgsql-9.3/bin/pg_config
extconf.rb:34: warning: Insecure world writable dir /opt/anaconda in PATH, mode 040777
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -l/usr/lib64/libpqxx-4.0.so... 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.

已安装的pg库:Installed Packages postgresql93.x86_64 9.3.16-1PGDG.rhel6

postgresql93-contrib.x86_64 9.3.16-1PGDG.rhel6

postgresql93-debuginfo.x86_64 9.3.16-1PGDG.rhel6

postgresql93-devel.x86_64 9.3.16-1PGDG.rhel6

postgresql93-docs.x86_64 9.3.16-1PGDG.rhel6

postgresql93-libs.x86_64 9.3.16-1PGDG.rhel6

postgresql93-odbc.x86_64 09.06.0100-1PGDG.rhel6

postgresql93-odbc-debuginfo.x86_64 09.03.0400-1PGDG.rhel6

postgresql93-plperl.x86_64 9.3.16-1PGDG.rhel6

postgresql93-plpython.x86_64 9.3.16-1PGDG.rhel6

postgresql93-pltcl.x86_64 9.3.16-1PGDG.rhel6

postgresql93-server.x86_64 9.3.16-1PGDG.rhel6

postgresql93-tcl.x86_64 2.1.1-1.rhel6

postgresql93-tcl-debuginfo.x86_64 2.1.1-1.rhel6

postgresql93-test.x86_64 9.3.16-1PGDG.rhel6

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-04-26 15:19:15

我有一个linux包管理器,它有一些旧的依赖项,扰乱了pg gem的安装。

答案是:

  • 删除linux brew 1:http://linuxbrew.sh/
  • 用RVM卸载Ruby
  • 内爆RVM
  • 重新安装RVM
  • 重新安装红宝石
  • 使用pg配置选项安装pg gem:

gem install pg -- --with-pg-config=/usr/pgsql-9.3/bin/pg_config

票数 1
EN

Stack Overflow用户

发布于 2017-04-25 14:55:57

你试过这个吗?

代码语言:javascript
复制
$ sudo su
$ env ARCHFLAGS="-arch x86_64" gem install pg
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43612719

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档