Ruby 如何在Debian上安装pg gem以用于AWS beanstalk应用程序?
这一个已经在stackoverflow上以多种形式出现,但我仍然无法让它工作,尽管进行了多次搜索和尝试。基本上我做了:Ruby 如何在Debian上安装pg gem以用于AWS beanstalk应用程序?,ruby,postgresql,amazon-web-services,amazon-elastic-beanstalk,Ruby,Postgresql,Amazon Web Services,Amazon Elastic Beanstalk,这一个已经在stackoverflow上以多种形式出现,但我仍然无法让它工作,尽管进行了多次搜索和尝试。基本上我做了: sudo apt-get install postgresql-client libpq5 libpq-dev sudo gem install pg 我已经试过了 bundle config build.pg --with-pg-config=/usr/lib/postgresql94/bin/pg_config sudo gem install pg -- --with-
sudo apt-get install postgresql-client libpq5 libpq-dev
sudo gem install pg
我已经试过了
bundle config build.pg --with-pg-config=/usr/lib/postgresql94/bin/pg_config
sudo gem install pg -- --with-pg-config=/usr/bin/pg_config
我仍然从日志中得到错误消息,上面写着:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9 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.
这让我很难过,有人设法解决了吗?我正在本地机器上使用debian jessie
一如既往地感谢您。将Elastic Beanstalk实例上的包配置为顶级.ebextensions文件夹中的.config文件
# .ebextensions/packages.config
packages:
yum:
postgresql-devel: []
并重新部署应用程序
有关完整步骤,请查看以下内容:
抱歉,与aws LogsHanks发出的错误消息完全相同。“重新部署应用程序”是指在aws控制台上执行git推送还是“重建环境”?或者别的什么?我做了一个git推送,并且在aw控制台上重新启动了服务器,仍然得到相同的错误。我将packages.config文件放在.ebextensions文件夹中。您是否已将database.yml配置为与RDS postgres一起使用,并将AWS EBS中的DB引擎更改为“postgres”?我将从头再做一遍,然后告诉您结果。我感谢你的帮助