2015-11-06 86 views
1

我有一个最近推送到'生产'VPS托管服务器的rails应用程序。我使用Capistrano进行部署,似乎已经将其转移到了服务器上。我改变了应用程序的当前目录就跑捆绑安装,开始让一切设置和打这个错误:生产服务器上的捆绑安装失败

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

    /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151105-8574-y7clqw.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. 

我不熟悉这个错误,这是未知的领域对我,所以我有点丢失。我能够得到服务器上的postgres using this information from postgresql wiki.

我很确定这是一个简单的修复,我只是不熟悉设置一个新的服务器,所以我不知道我在这里做什么!

编辑:

正如下面的建议,我添加的lib和DEV包到我的服务器。我在/usr/pgsql-9.3/bin找到了pg_conf,但我的应用程序似乎无法找到它,导致上述错误。当我尝试执行$ bundle install --with-pg-config=/usr/pgsql-9.3/bin正如上面的错误输出中所建议的,我收到一个Unknown switches '--with-pg-config=/usr/pgsql-9.3/bin'错误。

我应该如何映射文件?在这里还有其他事情我不明白?

回答

0

SSH到您的生产机器和安装postgresql-devel包的机器上,这将解决pg_config missing问题:

sudo apt-get install libpq-dev