Rails弹性Beanstalk无法部署 -

时间:2016-11-21 03:21:30

标签: ruby-on-rails elastic-beanstalk

错误说cannot allocate memory,但很多谷歌搜索显示原生宝石在豆茎上遇到麻烦。

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

      /opt/rubies/ruby-2.1.10/bin/ruby extconf.rb
  Cannot allocate memory - /opt/rubies/ruby-2.1.10/bin/ruby extconf.rb 2>&1

  Gem files will remain installed in /opt/rubies/ruby-2.1.10/lib/ruby/gems/2.1.0/gems/json-1.8.3 for inspection.
  Results logged to /opt/rubies/ruby-2.1.10/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/json-1.8.3/gem_make.out

有没有办法验证beanstalk可以毫无问题地安装这个gem?

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:0)

让构建系统包所有依赖项占用的资源比默认EC2实例可以处理的资源多。

在ElasticBeanstalk部署期间增加EC2实例/ Swapfile的大小以解决此问题。

检查我之前的回复here