gpt4 book ai didi

ruby-on-rails - pg gem 安装失败

转载 作者:数据小太阳 更新时间:2023-10-29 08:58:18 24 4
gpt4 key购买 nike

Centos 6.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:

gem install pg -- --with-pqlib=/usr/lib64/libpqxx-4.0.so --with-pg-config=/usr/pgsql-9.3/bin/pg_config

我一直试图为它提供不同的库,但它卡住的是一些 PQconnectdb()功能。下方错误

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

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<br/>
postgresql93-contrib.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-debuginfo.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-devel.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-docs.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-libs.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-odbc.x86_64 09.06.0100-1PGDG.rhel6<br/>
postgresql93-odbc-debuginfo.x86_64 09.03.0400-1PGDG.rhel6<br/>
postgresql93-plperl.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-plpython.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-pltcl.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-server.x86_64 9.3.16-1PGDG.rhel6<br/>
postgresql93-tcl.x86_64 2.1.1-1.rhel6<br/>
postgresql93-tcl-debuginfo.x86_64 2.1.1-1.rhel6<br/>
postgresql93-test.x86_64 9.3.16-1PGDG.rhel6

最佳答案

你试过吗?

$ sudo su
$ env ARCHFLAGS="-arch x86_64" gem install pg

关于ruby-on-rails - pg gem 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43612719/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com