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

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?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 18 (3 by maintainers)

Most upvoted comments

gem install backup -v5.0.0.beta.1

Use 5.0.0.beta.1 for Ruby 2.4

gem install backup -v5.0.0.beta.1 also work with ruby 3.0.2