libpq-fe.h not found in rails gempg installation

Asked 2 years ago, Updated 2 years ago, 86 views

When I try to install gempg in rails,

Error like libpq-fe.h not found

I have a lot of information, but centos is

$sudo yum install postgresql-develop

You said you should run , but now you install it and then bundle install it.

The postgresql version is said to be too old.

Also, even if I install a new one, it doesn't work and it's looped.I can't solve it, what should I do?

The same question was asked, but it seems to be unresolved
gem install pg fails.yum install postgresql-devel also does not resolve.

ruby-on-rails centos

2022-09-30 20:22

1 Answers

Post Your Own

Problem: Gem install pg with rails fails.yum install postgresql-devel also does not resolve.
environment:centos6

The tentative solution seems to be to install gempg by specifying the directory where postgresql is located, and then setting the bundle install to go through (actually resolved).

□In my case, postgresql was as follows.

/usr/pgsql-11

Install gempg in the above location

$gem install pg ----with-pg-dir=/usr/pgsql-11

□ Next, set the bundle install to go through

bundle config build.pg --- with-pg-dir=/usr/pgsql-11

This should go through bundle install

bundle install# OK


2022-09-30 20:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.