LoginSignup
15
10

More than 5 years have passed since last update.

centos7でsassc 2.0.0 with native extensionsのインストールに失敗

Posted at

bundleに失敗するから、sasscだけ単独でインストールしてみた所、以下のエラーが発生。

$ gem install sassc -v '2.0.0' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR:  Error installing sassc:
    ERROR: Failed to build gem native extension.

    current directory: /home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.0/ext
/home/foo/.rbenv/versions/2.5.3/bin/ruby -rrubygems /home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rake-12.3.1/exe/rake RUBYARCHDIR=/home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/sassc-2.0.0 RUBYLIBDIR=/home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/sassc-2.0.0
cd libsass
make lib/libsass.so
mkdir lib
cc -Wall -O2 -I /home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.0/ext/libsass/include -fPIC -fPIC -c -o src/cencode.o src/cencode.c
src/cencode.c: 関数 ‘base64_encode_block’ 内:
src/cencode.c:50:5: 警告: 空の宣言です [デフォルトで有効]
     __attribute__ ((fallthrough));
     ^
src/cencode.c:64:5: 警告: 空の宣言です [デフォルトで有効]
     __attribute__ ((fallthrough));
     ^
g++ -Wall -O2 -std=c++0x -I /home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.0/ext/libsass/include -fPIC -fPIC -c -o src/ast.o src/ast.cpp
make: g++: コマンドが見つかりませんでした
make: *** [src/ast.o] エラー 127
rake aborted!
Command failed with status (2): [make lib/libsass.so...]

Tasks: TOP => lib/libsass.so
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in /home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sassc-2.0.0 for inspection.
Results logged to /home/foo/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/sassc-2.0.0/gem_make.out

gcc-c++が足りていないだけ。

$ sudo yum install gcc-c++

あらためてインストールし、成功

$ gem install sassc -v '2.0.0' --source 'https://rubygems.org/' 
Building native extensions. This could take a while...
Successfully installed sassc-2.0.0
Parsing documentation for sassc-2.0.0
Installing ri documentation for sassc-2.0.0
Done installing documentation for sassc after 4 seconds
1 gem installed
15
10
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
15
10