繁体   English   中英

无法在AWS中安装Postgres

[英]Unable to install postgres in AWS

我正在尝试从Heroku迁移到AWS

我使用以下自定义JSON创建了一个堆栈:

{
  "deploy": {
    "appname": {
      "database": {
        "username": "myuser",
        "password": "password",
        "database": "databasename",
        "host": "rdsendpoint",
        "port": "5432",
        "adapter": "postgresql"
      }
    }
  }
}

我创建了一个RDS postgres数据库和一个Rails App Server。 我创建了一个实例和一个链接到我的git仓库的应用程序。

但是,实例无法启动,并且我收到此错误消息:

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


/usr/local/bin/ruby 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.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/

extconf failed, exit code 1

Gem files will remain installed in /home/deploy/.bundler/authorship/ruby/2.0.0/gems/pg-0.18.2 for inspection.
Results logged to /home/deploy/.bundler/authorship/ruby/2.0.0/extensions/x86_64-linux/2.0.0/pg-0.18.2/gem_make.out
An error occurred while installing pg (0.18.2), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.2'` succeeds before bundling.

我如何在AWS上解决此问题,因为无法启动ssh无法启动该实例。

我试图将postgres-devel软件包添加到该层,但是出现了另一个错误,似乎该软件包不再可用。

由于实例没有此包libpq-dev

sudo apt-get install libpq-dev

这样就可以安装pg gem了。

这是libpq-dev的描述:

头文件和静态库,用于编译C程序以与libpq库链接,以便与PostgreSQL数据库后端进行通信。

pg gem是包装libpq库的本机扩展。

PS我最近遇到了这个问题,我得到了其他小组的一些解释。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM