在Centos上安装pg gem时,Capistrano捆绑安装失败

时间:2014-11-17 01:02:30

标签: ruby-on-rails postgresql rvm vps

我正在使用Capistrano向Centos VPS部署Rails应用程序。在我的VPS上我可以安装宝石pg,但是当我运行cap staging deploy时,由于

,该过程失败了
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.

当命令&#; cd / var / www / projectx / releases / 20141117004357&& / usr / local / rvm / bin / rvm默​​认执行bundle install --binstubs / var / www / projectx / shared / bin --path / var / www / projectx / shared / bundle --without development test --deployment - 安静'

所以在VPS上我可以全局安装pg gem,但是当它在我的发布目录中运行bundle时失败了cd / var / www / projectx / releases / 20141117004357

错误:

Gem :: Ext :: BuildError:错误:无法构建gem原生扩展。

/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.

是由--with-pg-config = / opt / local / lib / postgresql91 / bin / pg_config引起的,我的pg_config是一个不同的位置,我该如何更改?

任何想法?

由于

0 个答案:

没有答案