如何在 Ubuntu 上安装 PostgreSQL 的 pg gem?

编程入门 行业动态 更新时间:2024-10-10 06:18:45
本文介绍了如何在 Ubuntu 上安装 PostgreSQL 的 pg gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试为 Ruby 安装 PostgreSQL 的 pg gem.

I'm trying to install PostgreSQL's pg gem for Ruby.

我发出了以下命令:

gem install pg

我使用 RVM 安装了 Ruby 1.9.2.

I installed Ruby 1.9.2 using RVM.

上面的命令显示了以下错误.

The above command shows me the following error.

错误是:

Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/User/.rvm/rubies/ruby-1.9.2-preview3/bin/ruby extconf.rb checking for pg_config... yes checking for libpq-fe.h... yes checking for libpq/libpq-fs.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=/home/User/.rvm/rubies/ruby-1.9.2-preview3/bin/ruby --with-pg --without-pg --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 --enable-static-build --disable-static-build --with-pqlib --without-pqlib --with-libpqlib --without-libpqlib --with-ms/libpqlib --without-ms/libpqlib Gem files will remain installed in /home/user/.rvm/gems/ruby-1.9.2-preview3/gems/pg-0.9.0 for inspection. Results logged to /home/user/.rvm/gems/ruby-1.9.2-preview3/gems/pg-0.9.0/ext/gem_make.out

我不知道是什么错误...

I don't know what is the error...

推荐答案

您需要安装带有PostgreSQL头文件的postgreSQL开发包

You need install the postgreSQL dev package with header of PostgreSQL

sudo apt-get install libpq-dev

更多推荐

如何在 Ubuntu 上安装 PostgreSQL 的 pg gem?

本文发布于:2023-10-14 03:51:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1489943.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Ubuntu   PostgreSQL   pg   gem

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!