Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sassc gem is not installing on Ubuntu 18.04 LTS #204

Open
vigneshrams opened this issue May 22, 2020 · 12 comments
Open

Sassc gem is not installing on Ubuntu 18.04 LTS #204

vigneshrams opened this issue May 22, 2020 · 12 comments

Comments

@vigneshrams
Copy link

Building native extensions. This could take a while...
ERROR: Error installing sassc-rails:
ERROR: Failed to build gem native extension.

current directory: /home/ubuntu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0/ext

/home/ubuntu/.rbenv/versions/2.7.1/bin/ruby -I /home/ubuntu/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200522-11294-c5h69d.rb extconf.rb
creating Makefile

current directory: /home/ubuntu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0/ext
make "DESTDIR=" clean

current directory: /home/ubuntu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0/ext
make "DESTDIR="
compiling ./libsass/src/ast.cpp
compiling ./libsass/src/ast2c.cpp
compiling ./libsass/src/ast_fwd_decl.cpp
compiling ./libsass/src/ast_sel_cmp.cpp
compiling ./libsass/src/ast_sel_super.cpp
compiling ./libsass/src/ast_sel_unify.cpp
compiling ./libsass/src/ast_sel_weave.cpp
compiling ./libsass/src/ast_selectors.cpp
compiling ./libsass/src/ast_supports.cpp
compiling ./libsass/src/ast_values.cpp
compiling ./libsass/src/backtrace.cpp
compiling ./libsass/src/base64vlq.cpp
compiling ./libsass/src/bind.cpp
compiling ./libsass/src/c2ast.cpp
compiling ./libsass/src/c99func.c
compiling ./libsass/src/cencode.c
compiling ./libsass/src/check_nesting.cpp
compiling ./libsass/src/color_maps.cpp
compiling ./libsass/src/constants.cpp
compiling ./libsass/src/context.cpp
compiling ./libsass/src/cssize.cpp
compiling ./libsass/src/emitter.cpp
compiling ./libsass/src/environment.cpp
compiling ./libsass/src/error_handling.cpp
compiling ./libsass/src/eval.cpp
compiling ./libsass/src/eval_selectors.cpp
compiling ./libsass/src/expand.cpp
compiling ./libsass/src/extender.cpp
compiling ./libsass/src/extension.cpp
compiling ./libsass/src/file.cpp
compiling ./libsass/src/fn_colors.cpp
compiling ./libsass/src/fn_lists.cpp
compiling ./libsass/src/fn_maps.cpp
compiling ./libsass/src/fn_miscs.cpp
compiling ./libsass/src/fn_numbers.cpp
compiling ./libsass/src/fn_selectors.cpp
compiling ./libsass/src/fn_strings.cpp
compiling ./libsass/src/fn_utils.cpp
compiling ./libsass/src/inspect.cpp
compiling ./libsass/src/json.cpp
compiling ./libsass/src/lexer.cpp
compiling ./libsass/src/listize.cpp
compiling ./libsass/src/memory/SharedPtr.cpp
compiling ./libsass/src/operators.cpp
compiling ./libsass/src/output.cpp
compiling ./libsass/src/parser.cpp
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
Makefile:236: recipe for target 'parser.o' failed
make: *** [parser.o] Error 4

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/sassc-2.3.0 for inspection.
Results logged to /home/ubuntu/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/sassc-2.3.0/gem_make.out

Please help me with it.
./Thanks

@claasz
Copy link

claasz commented Jun 25, 2020

We've experienced similar problems when installing an a server with 0.5GB RAM only. Looks like installation requires at least 1GB of RAM.

g++: internal compiler error: Killed (program cc1plus)

Could be an out-of-memory error.

@weili-git
Copy link

Same problem on Ubuntu 18.04 LTS, hope someone could help. Thanks.

@weili-git
Copy link

Temporarily, I try to modify the Gemfile and set "gem 'sass-rails', '= 5.1.0'".

@ceilingrat
Copy link

I'm having this issue as well.

I'm using Repl.it and the environment is running Ubuntu 18.04.

I've detailed my troubleshooting efforts on a post in the Repl.it support forum:
https://repl.it/talk/ask/Package-Installation-failing-on-SASSC/53457

My test environment is available online and the output of bundler can be found here:
https://repl.it/@ceilingrat/jekyll-1

@arianitu
Copy link

arianitu commented Jan 7, 2021

Running into this as well, does anyone know if there is a way to compile sassc without so much memory?

Edit:

Temporary solution is to change your Gemfile.lock to point to saasc 2.1.0 instead of saasc 2.4.0, it seems 2.1.0 has pre-built binaries, but 2.4.0 requires building from source which can take a long time + require a lot of resources (1GB of RAM at least it appears and minutes of compilation time, some people it takes 7+ minutes.)

See #189

@ceilingrat
Copy link

point to saasc 2.1.0 instead of saasc 2.4.0

This sounds like a really great solution.
However, in case anyone really needs the latest version, here's an alternative workaround that I had some success with:

Instead of relying on RubyGems to install the saasc package, I just cloned the saasc git repo.
(in my experiments, I forked the repo prior to cloning it to my environment, but I only did so because it was quick using my tools & workflow. I suspect the fork is probably unnecessary. Your mileage may vary.)

@ryankopf
Copy link

Seconding this as an ongoing issue.

@jathayde
Copy link

Still persisting on a new 18.04 LTS instance on Azure. locking the gem to 2.1 does work.

nileshtrivedi added a commit to learn-awesome/learn that referenced this issue May 29, 2021
@tekpriest
Copy link

Facing this issue locally on an Arch

@KevinTriplett
Copy link

KevinTriplett commented Nov 25, 2022

Same issue with x86_64 Debian 11 on a 0.5GB production server (small run app) and sassc 2.4.0 -- bundle is killed while building native extensions.

@hegwin
Copy link

hegwin commented Mar 21, 2023

I met the same issue on a 18.04 LTS with 1GB memory.

When it's Building native extensions..., I can see the CPU Utilization is just around 15%. Meanwhile, I can't see the memory usage, but I can see the Disk Read BPS is extremely high and Disk Write is almost 0. So is this a thrash?

I tried to lock back to 2.1.0 but then I can't do bundle install in my M1 Mac:

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

    current directory: /Users/hegwin/.rvm/gems/ruby-2.7.3/gems/sassc-2.1.0/ext
/Users/hegwin/.rvm/rubies/ruby-2.7.3/bin/ruby -I /Users/hegwin/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0 -r ./siteconf20230321-79567-o5x5e7.rb extconf.rb
creating Makefile

current directory: /Users/hegwin/.rvm/gems/ruby-2.7.3/gems/sassc-2.1.0/ext
make "DESTDIR=" clean

current directory: /Users/hegwin/.rvm/gems/ruby-2.7.3/gems/sassc-2.1.0/ext
make "DESTDIR="
compiling ./libsass/src/units.cpp
clang: error: the clang compiler does not support '-march=native'
make: *** [units.o] Error 1

make failed, exit code 2

I'm in a dilemma

@timokleemann
Copy link

If you happen to be at a host such as DigitalOcean, the solution is fairly simple:

Just resize your droplet from 1 GB to 2 GB, then run bundle again and the installation should complete without any problems. After that just resize your droplet back to 1 GB.

I've already done this with two different Ruby on Rails projects in the past weeks and it worked both times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests