LoginSignup
12
8

More than 5 years have passed since last update.

「libpq-fe.h が見つけられない。」の解決法でも上手く行かない場合

Posted at

問題の概要

①Amazon LinuxでPostgreSQLインストール後、bundle installしたら、pqエラーが発生
②下記のQiita記事を参考に、コマンドを入力したが、解決出来ず。

$ sudo yum install postgresql-devel

参考URL:libpq-fe.h が見つけられない。
③発生したエラーは以下の通り

$ bundle install --path vendor/bundle

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***

An error occurred while installing pg (1.1.3), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.1.3' --source 'https://rubygems.org/'`
succeeds before bundling.

解決法

下記のサイトで同様の質問があり、回答通りに解決方法を試したら、無事に動作しました。
https://forums.aws.amazon.com/thread.jspa?threadID=268964

$  sudo yum install postgresql96 postgresql96-server postgresql96-libs postgresql96-contrib postgresql96-devel 

最後に

同じような問題に悩んでいる方に役立てられればと思い、今回の記事に纏めました。

12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8