postgresql – gem install pg –with-pg-config工作,捆绑失败

前端之家收集整理的这篇文章主要介绍了postgresql – gem install pg –with-pg-config工作,捆绑失败前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我运行(作为根)
  1. gem install pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config

我得到以下输出

  1. #-> gem instal pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config
  2. Building native extensions. This could take a while...
  3. Successfully installed pg-0.12.0
  4. 1 gem installed
  5. Installing ri documentation for pg-0.12.0...
  6. Installing RDoc documentation for pg-0.12.0...
  7. #->

当我运行捆绑安装:

  1. Installing pg (0.12.0) with native extensions
  2. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  3.  
  4. /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
  5. checking for pg_config... no
  6. No pg_config... trying anyway. If building fails,please try again with
  7. --with-pg-config=/path/to/pg_config
  8. checking for libpq-fe.h... no
  9. Can't find the 'libpq-fe.h header
  10. *** extconf.rb Failed ***
  11. Could not create Makefile due to some reason,probably lack of
  12. necessary libraries and/or headers. Check the mkmf.log file for more
  13. details. You may need configuration options.
  14.  
  15. Provided configuration options:
  16. --with-opt-dir
  17. --with-opt-include
  18. --without-opt-include=${opt-dir}/include
  19. --with-opt-lib
  20. --without-opt-lib=${opt-dir}/lib
  21. --with-make-prog
  22. --without-make-prog
  23. --srcdir=.
  24. --curdir
  25. --ruby=/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby
  26. --with-pg
  27. --without-pg
  28. --with-pg-dir
  29. --without-pg-dir
  30. --with-pg-include
  31. --without-pg-include=${pg-dir}/include
  32. --with-pg-lib
  33. --without-pg-lib=${pg-dir}/lib
  34. --with-pg-config
  35. --without-pg-config
  36. --with-pg_config
  37. --without-pg_config
  38.  
  39.  
  40. Gem files will remain installed in /var/www/simpletrac/vendor/cache/ruby/1.9.1/gems/pg- 0.12.0 for inspection.
  41. Results logged to /var/www/simpletrac/vendor/cache/ruby/1.9.1/gems/pg-0.12.0/ext/gem_make.out
  42. An error occured while installing pg (0.12.0),and Bundler cannot continue.
  43. Make sure that `gem install pg -v '0.12.0'` succeeds before bundling.

我有libpq-fe.h安装在/usr/pgsql-9.1/include/libpq-fe.h。所以,我试过

  1. gem install pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config --with-pg-lib=/usr/pgsql-9.1/include/libpq-fe.h but still no go.

任何帮助将不胜感激。

此外,我已经安装了postgresql91-devel和ruby-devel。运行CentOS 6。

你试过运行这之前运行捆绑安装?
  1. bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config

http://bundler.io/v1.3/bundle_config.html

猜你在找的Postgre SQL相关文章