ubuntu で gem install do_postgres に失敗した
$ gem install do_postgres
したら以下のようにエラーになった。
Building native extensions. This could take a while...
ERROR: Error installing do_postgres:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 -r ./siteconf20150308-31837-a4mid6.rb extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... no
*** 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=/usr/bin/ruby2.1
--with-pgsql-server-dir
--without-pgsql-server-dir
--with-pgsql-server-include
--without-pgsql-server-include=${pgsql-server-dir}/include
--with-pgsql-server-lib
--without-pgsql-server-lib=${pgsql-server-dir}/lib
--with-pgsql-client-dir
--without-pgsql-client-dir
--with-pgsql-client-include
--without-pgsql-client-include=${pgsql-client-dir}/include
--with-pgsql-client-lib
--without-pgsql-client-lib=${pgsql-client-dir}/lib
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/do_postgres-0.10.15 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/do_postgres-0.10.15/gem_make.out
予め以下のものを入れておく必要があるみたい。
$ sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 libpq-dev
これでおっけー。