bundle installしたらこけました(☝ ՞ਊ ՞)
pgのインストールで失敗
bundle installが失敗します。
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/vagrant/.rbenv/versions/2.0.0-p247/bin/ruby 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.
略
Gem files will remain installed in /home/vagrant/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.15.1 for inspection.
Results logged to /home/vagrant/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.15.1/ext/gem_make.out
An error occurred while installing pg (0.15.1), and Bundler cannot continue.
Make sure that `gem install pg -v ‘0.15.1’` succeeds before bundling.
pgのところで失敗します。
postgresql-libsをインストールする
CentOSでpostgresql-libsをインストールするといいみたいです。
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
略
Installed:
postgresql-devel.x86_64 0:8.4.18-1.el6_4
Dependency Installed:
postgresql.x86_64 0:8.4.18-1.el6_4 postgresql-libs.x86_64 0:8.4.18-1.el6_4
Complete!
この後にbundle installしたらうまくいきました。
参考:http://serverfault.com/questions/316703/how-to-install-libpq-dev-on-centos-5-5
まとめ
CentOSでpgをいれるときはpostgresql-libsを入れるといいようです(☝ ՞ਊ ՞)☝