Skip to content

ERROR: Failed to build gem native extension (json-1.8.2) when installing #877

@jmuheim

Description

@jmuheim

I can't install backup gem on my UNIX server:

[hmktnt@lepus ~]$ gem install backup
Building native extensions.  This could take a while...
ERROR:  Error installing backup:
	ERROR: Failed to build gem native extension.

    current directory: /home/hmktnt/.gem/ruby/2.4.0/gems/json-1.8.2/ext/json/ext/generator
/package/host/localhost/ruby-2.4.1/bin/ruby -r ./siteconf20170725-22241-1071ukr.rb extconf.rb
creating Makefile

current directory: /home/hmktnt/.gem/ruby/2.4.0/gems/json-1.8.2/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/hmktnt/.gem/ruby/2.4.0/gems/json-1.8.2/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:867: error: ‘rb_cFixnum’ undeclared (first use in this function)
generator.c:867: error: (Each undeclared identifier is reported only once
generator.c:867: error: for each function it appears in.)
generator.c:869: error: ‘rb_cBignum’ undeclared (first use in this function)
At top level:
cc1: warning: unrecognized command line option "-Wno-self-assign"
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand"
cc1: warning: unrecognized command line option "-Wno-parentheses-equality"
cc1: warning: unrecognized command line option "-Wno-tautological-compare"
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/hmktnt/.gem/ruby/2.4.0/gems/json-1.8.2 for inspection.
Results logged to /home/hmktnt/.gem/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/json-1.8.2/gem_make.out

I tried it with a newer json gem:

[hmktnt@lepus ~]$ gem install json -v '1.8.6'
Fetching: json-1.8.6.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.8.6
1 gem installed

But this didn't help. Any idea on how to proceed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions