gpt4 book ai didi

ruby-on-rails - 使用 Ubuntu 的 pg gem

转载 作者:行者123 更新时间:2023-12-01 05:27:08 28 4
gpt4 key购买 nike

我正在尝试使用新的 rails 应用程序安装 pg gem,但我一直收到相同的错误:

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

/home/arthur/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb --with-pg-lib=/usr/lib
checking for pg_config... yes
Using config values from /usr/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.

我已经尝试了这个问题的所有内容: How to install PostgreSQL's pg gem on Ubuntu?
但没有什么对我有用。

顺便说一下,那是 ruby​​ 1.9.2 和 Rails 3.2。

谢谢

最佳答案

安装 postgresql 9,然后安装您的 gem。

sudo apt-get install postgresql libpq-dev

现在,运行
gem install pg

进而

捆绑安装

关于ruby-on-rails - 使用 Ubuntu 的 pg gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13276428/

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