find_executable:
1 2-------------------- 3 4find_header: checking for libpq-fe.h... -------------------- no 5 6"gcc -o conftest -I/home/ec2-user/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/x86_64-linux -I/home/ec2-user/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/backward -I/home/ec2-user/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0 -I. -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -fPIC conftest.c -L. -L/home/ec2-user/.rvm/rubies/ruby-2.5.3/lib -Wl,-rpath,/home/ec2-user/.rvm/rubies/ruby-2.5.3/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/ec2-user/.rvm/rubies/ruby-2.5.3/lib -L/home/ec2-user/.rvm/rubies/ruby-2.5.3/lib -lruby -lpthread -ldl -lcrypt -lm -lc" 7checked program was: 8/* begin */ 91: #include "ruby.h" 102: 113: int main(int argc, char **argv) 124: { 135: return 0; 146: } 15/* end */ 16 17"gcc -E -I/home/ec2-user/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/x86_64-linux -I/home/ec2-user/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/backward -I/home/ec2-user/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0 -I. -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -fPIC conftest.c -o conftest.i" 18conftest.c:3:22: fatal error: libpq-fe.h: No such file or directory 19 #include <libpq-fe.h> 20 ^ 21compilation terminated. 22checked program was: 23/* begin */ 241: #include "ruby.h" 252: 263: #include <libpq-fe.h> 27/* end */ 28 29-------------------- 30コード
Can't find the 'libpq-fe.h headerと書いてあったので
brew install postgresql
をしましたが
bash: brew: command not found
と出てしまい困っています。。。
初心者です。よろしくお願いいたします。
気になる質問をクリップする
クリップした質問は、後からいつでもMYページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/19 02:38

回答2件
0
AmazonLinuxでは、パッケージ管理コマンドはyum
を使用します。
https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/managing-software.html
以下で開発用パッケージをインストールしてください。
Bash
1sudo yum install postgresql-devel
同じような事例を見つけました。
https://qiita.com/s-yank/items/035938249ba3b158b865
追加で以下のパッケージをインストールしてみてください。
Bash
1sudo yum install postgresql96 postgresql96-server postgresql96-libs postgresql96-contrib postgresql96-devel
以下の要領で、まずはpg_configコマンドのありかを探します。
Bash
1$ ls /usr 2...(中略)... pgsql-9.x ...(中略)... 3 4↓「ls /usr」の実行結果表示されたバージョン番号で、次のディレクトリを指定してください。 5$ ls /usr/pgsql-9.x/bin 6...(中略)... pg_config ...(中略)...
次に、見つかったディレクトリのパスを使って、「PATHを通し」ます。
~/.bash_profile
に以下のように記載します。
Bash
1export PATH=/usr/pgsql-9.x/bin:$PATH
最後に、それを読み込んで、PATHを有効化します。
Bash
1$ source ~/.bash_profile
投稿2019/03/11 05:54
編集2019/03/15 08:14総合スコア7196
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。

0
どこで、何をしていてこのエラーが発生したのでしょうか?
質問には、「どこで、なにをして どうなった。(ので、どうしたい。)」を具体的に記載していただけないでしょうか?
データベースは、EC2 に PostgreSQL をインストールしてあるのでしょうか?
それとも Amazon RDS for PostgreSQL を使うのでしょうか?
エラーメッセージからすると おそらく、お使いの環境に PostgreSQL のヘッダファイルがインストールされていないのだと思われますが、お使いのサーバー環境が不明なので brew でインストールできるかは不明です。( brew は、macOS 用のパッケージマネージャです。)
エラーメッセージを見る限り EC2 のように見えるのですが... EC2 にインストールされている OS が不明ですが、 Amazon Linux なら 管理者権限で、yum install postgresql-devel
あたりでしょうか。
なお、お使いのバージョンによっては、パッケージ名にバージョンが入っている場合もあるので、 yum list | grep postgre
で PostgreSQL 関連のパッケージの一覧を確認して、必要なパッケージを選んでください。
投稿2019/03/11 05:57
総合スコア25234
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。

あなたの回答
tips
太字
斜体
打ち消し線
見出し
引用テキストの挿入
コードの挿入
リンクの挿入
リストの挿入
番号リストの挿入
表の挿入
水平線の挿入
プレビュー
質問の解決につながる回答をしましょう。 サンプルコードなど、より具体的な説明があると質問者の理解の助けになります。 また、読む側のことを考えた、分かりやすい文章を心がけましょう。