1

I am deploying Rails app using Capistrano to Centos VPS. On my VPS I can gem install pg, however when I run cap staging deploy, the process failed due to

An error occurred while installing pg (0.17.1), and Bundler cannot continue.
DEBUG[07a4f16d]     Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.

When the command 'cd /var/www/projectx/releases/20141117004357 && /usr/local/rvm/bin/rvm default do bundle install --binstubs /var/www/projectx/shared/bin --path /var/www/projectx/shared/bundle --without development test --deployment --quiet'

So on the VPS I can install pg gem globally, but it failed when it trys to run bundle in my release directory cd /var/www/projectx/releases/20141117004357

The error :

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20141116-8316-zgkk04.rb extconf.rb        --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config
Using config values from /opt/local/lib/postgresql91/bin/pg_config
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
sh: /opt/local/lib/postgresql91/bin/pg_config: No such file or directory
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.

Is it caused by --with-pg-config=/opt/local/lib/postgresql91/bin/pg_config, my pg_config is is a different location, how do I change this?

any idea?

Thanks

user1883793
  • 4,011
  • 11
  • 36
  • 65
  • Already answered here http://stackoverflow.com/questions/9234960/gem-install-pg-with-pg-config-works-bundle-fails – user1883793 Nov 17 '14 at 01:16

0 Answers0