0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

debianディストリビューションでgem install時にGem::Ext::BuildError: ERROR: Failed to build gem native extension.が出る

Last updated at Posted at 2020-10-29

#背景
docker-composeでbundleインストール時に、sasscをインストールしてくれと怒られ実行したところOSが起動しなくなったので共有します。

#実行環境
debian 10.6
rails 5.2.4.3

#事象
下記エラーで5分ほどたったあと、サーバーが壊れる

# gem install sassc -v '2.4.0' --source 'https://rubygems.org/'
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    current directory: /usr/local/bundle/gems/sassc-2.4.0/ext
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.4.0 -r
./siteconf20201026-6-pwczrb.rb extconf.rb
extconf failedCannot allocate memory - /usr/local/bin/ruby
Gem files will remain installed in /usr/local/bundle/gems/sassc-2.4.0 for
inspection.
Results logged to
/usr/local/bundle/extensions/x86_64-linux/2.4.0/sassc-2.4.0/gem_make.out
An error occurred while installing sassc (2.4.0), and Bundler cannot continue.
Make sure that `g @'`
succeeds before bundling.
In Gemfile:
  bootstrap was resolved to 4.5.2, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc

#原因
メモリが足りない
AWS無料枠でのインスタンスタイプを契約していて、メモリを1G→2Gに変更したところすんなり通った。

#メモリの増設方法
私はインスタンスタイプを変更することで、メモリを増設しました。(新しくOSを構築しました)
AWSインスタンスを起動→Amazonマシンイメージを選択(私の場合はRed Hat)→メモリ2GBを選択....(以下省略)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?