[已解决]opensuse 13.2 gem install pg 失败

包管理器用的 rbenv ,大概原因是没找到 pg_config ,但我 sudo zypper in postgresql 后 locate pg_config 依然没有。。。
关于 postgre 搜索后安装了如下包: libpq5, libpqxx-4_0, libpqxx-devel, postgresql, postgresql93

Building native extensions. This could take a while…
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.

current directory: /home/future_suse/.rbenv/versions/2.2.4/lib64/ruby/gems/2.2.0/gems/pg-0.18.4/ext

/home/future_suse/.rbenv/versions/2.2.4/bin/ruby -r ./siteconf20160506-13990-1vthz7g.rb extconf.rb
checking for pg_config… no
No pg_config… trying anyway. If building fails, please try again with
–with-pg-config=/path/to/pg_config
checking for libpq-fe.h… no
Can’t find the 'libpq-fe.h header
*** 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}/lib64
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/home/future_suse/.rbenv/versions/2.2.4/bin/$(RUBY_BASE_NAME)
–with-pg
–without-pg
–enable-windows-cross
–disable-windows-cross
–with-pg-config
–without-pg-config
–with-pg_config
–without-pg_config
–with-pg-dir
–without-pg-dir
–with-pg-include
–without-pg-include=${pg-dir}/include
–with-pg-lib
–without-pg-lib=${pg-dir}/lib64

To see why this extension failed to compile, please check the mkmf.log which can be found here:

差开发库, stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-pg-gem

sudo zypper in postgresql-devel
1赞