【问题标题】:Capistrano3 deployment error(ERROR: Failed to build gem native extension.)Capistrano3 部署错误(错误:无法构建 gem 原生扩展。)
【发布时间】:2014-04-23 07:36:17
【问题描述】:

在使用 capistrano3 部署期间安装包时出现以下错误

我的 Gemfile.lock 中有原子 gem,它要求我安装特定版本。
atomic (1.1.16) 并且手动安装在我的 ec2 机器上。但在部署过程中,它反复说以下内容。

$cap development deploy

INFO [44c32ab1] Running ~/.rvm/bin/rvm default do bundle install --binstubs /home/ec2-user/apps/dev/shared/bin --path /home/ec2-user/apps/dev/shared/bundle --without development test --deployment --quiet on 54.201.16.12
DEBUG [44c32ab1] Command: cd /home/ec2-user/apps/dev/releases/20140423071010 && ~/.rvm/bin/rvm default do bundle install --binstubs /home/ec2-user/apps/dev/shared/bin --path /home/ec2-user/apps/ybench_dev/shared/bundle --without development test --deployment --quiet

DEBUG [44c32ab1]    Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
DEBUG [44c32ab1]    
DEBUG [44c32ab1]        /home/ec2-user/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 
DEBUG [44c32ab1]    Cannot allocate memory - /home/ec2-user/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb  2>&1
DEBUG [44c32ab1]    
DEBUG [44c32ab1]    Gem files will remain installed in /home/ec2-user/apps/dev/shared/bundle/ruby/2.1.0/gems/atomic-1.1.16 for inspection.
DEBUG [44c32ab1]    Results logged to /home/ec2-user/apps/dev/shared/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/atomic-1.1.16/gem_make.out
DEBUG [44c32ab1]    An error occurred while installing atomic (1.1.16), and Bundler cannot continue.
DEBUG [44c32ab1]    Make sure that `gem install atomic -v '1.1.16'` succeeds before bundling.
cap aborted!

【问题讨论】:

  • 我认为您的 ec2 实例上有内存。请尝试在 ec2 实例上创建交换。
  • $df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 7.9G 4.4G 3.5G 57% / devtmpfs 285M 40K 285M 1% /dev tmpfs 298M 0 298M 0% /dev/嘘
  • 你的问题是内存,而不是磁盘空间

标签: ruby-on-rails ruby ruby-on-rails-4 rubygems capistrano3


【解决方案1】:

试试这个。

https://github.com/classmethod-aws/ec2-swap

ec2-swap:在 EC2 实例存储 ec2-swap 上创建和交换交换映像 是一个 RPM 包项目,用于在 EC2 上创建和交换交换映像 Linux 启动顺序上的实例存储。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-04
    • 2016-07-29
    • 1970-01-01
    • 2013-06-27
    • 2013-04-21
    • 1970-01-01
    • 2012-11-02
    • 1970-01-01
    相关资源
    最近更新 更多