LoginSignup
4

More than 5 years have passed since last update.

[Rails 4.x] Postgres を Rails に入れようと、 gem install pg をしようとしたら、 No pg_config とかエラーが出た場合

Last updated at Posted at 2014-07-25

エラー

PostgreSQLの Config ファイルがないよっていうエラーの様。
なので、configファイルの場所を指定して上げる方法もある。

$ gem install pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config

でも、そもそもConfigファイルがない場合があるので、その場合の対応が以下になるようです。

対応

CentOS

$ sudo yum -y install postgresql-devel

Ubuntu

$ sudo aptitude install libpq-dev

Mac OSX

$ brew install postgresql

Configファイル

/usr/local/Cellar/postgresql/9.3.2/bin/pg_config あたりにpg_configが生まれる。

参考

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
4