Solvedbackup 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?

15 Answers

✔️Accepted Answer

gem install backup -v5.0.0.beta.1

Other Answers:

Use 5.0.0.beta.1 for Ruby 2.4

Related Issues:

backup ERROR: Failed to build gem native extension (json-1.8.2) when installing
I can't install backup gem on my UNIX server: I tried it with a newer json gem: But this didn't help...
backup DropboxError: server response does not have offset key
I made a working fork with api V2 it's require api_token instead key and secret Token can be generat...
laravel backup Target [Spatie\Backup\Tasks\Cleanup\CleanupStrategy] is not instantiable while building
I found that ensuring the package is removed: composer remove spatie/laravel-backup clear the cache ...
restic Dry-Run Backup
Hm interesting idea thanks Maybe we can add this once #1494 is done e.g add some kind of backup --dr...
borg document pull-like operation
While having documentation for this workaround is great wouldn't it be better to add this functional...
elasticsearch dump Content-Type header [] is not supported
I answered my own question with a simple read of the documentation In order to help us troubleshoot ...
laravel backup File Not Found Exception Message when using Google Drive
That error is because you can't use the folder name you have to get the folder ID of the google driv...
restic Cannot find docs for the exclude file syntax
To answer a few of your questions already: All patterns are tested against the full path of a file/d...
oxidized Rugged::SshError: Failed to authenticate SSH session
If you have -----BEGIN OPENSSH PRIVATE KEY----- in your private key you need to change it to PEM for...
velero Add support for restoring to another zone [GCP]
Thanks for the script @stevegore -- I had to make some changes to get it to work for me but knowing ...
borg DistributionNotFound error with msgpack-python 0.5.0 installed
A slightly dirty workaround is to pip install msgpack-python. Borg fails to launch with msgpack-pyth...
restic support for the new Scaleway Object Storage (S3 compatible)
FYI this works both on nl-ams or fr-par region (with no ~/.aws/*): We do support SigV4 ...
pyodbc pip install pyodbc failing: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory #include <sql.h> ^ Your machine do...
psycopg2 psycopg2-binary fails to install on macOS Big Sur 11.0.1 and Python 3.9.0 (with possible workaround)
Actually figured it out Haven't worked on a Mac in a while and forgot about the PostgreSQL dependenc...
psycopg2 Installing psycopg2-binary with Python:3.6.4-alpine doesn't work
I found this solution which worked quite fine Edit The above compiles the package from source so I w...
sheetjs How to simply export a Worksheet to xlsx?
There are two issues: each object is mapped to a row so if you want a row with name John and city Se...
pyodbc fatal error: sql.h: No such file or directory
You don't have the required ODBC header files on your machine For example on Ubuntu you would need t...
react native firebase 🔥(Android) Program type already present: io.invertase.firebase.BuildConfig
I think I found my ultimate error here In my package.json file I had at some point earlier ...
typeorm Error: RepositoryNotFoundError: No repository for [Enitity] was found. Looks like this entity is not registered in current "default" connection? Issue type: [x] question [x] bug r...
dbal Unknown database type enum, MySQL57Platform may not support it
In case anyone else comes across this and is similarly dismayed by the complexity of the solutions o...
dbeaver "invalid privatekey" connecting through SSH tunnel
Run this on your key to convert it to RSA private key Helped me ssh-keygen -p -m PEM -f ~/.ssh/id_rs...
realm swift Realm/RLMArray.h file not found and Could not build Objective-C module 'Realm'
So I am a little ashamed that I didn't try this earlier but it appears that if I run Clean Build Fol...
prisma Prisma Migrate: Error creating shadow database
I just want to add a quick note for folks coming here from googling the error message that if you ar...
efcore No executable found matching command "dotnet-ef" even after adding CLI
I has this issue and like to share I want to Migrate my Database with Models I am using EF Core 2.0 ...
efcore UseSqlServer() method is missing from Microsoft.EntityFrameworkCore.SqlServer 1.1.1
Hm - try manually adding the using statement using Microsoft.EntityFrameworkCore; and building again...
Flask Migrate flask db init fails: KeyError 'migrate'
Hi fieldse Did you create a Migrate object? I get the same error when trying flask db init without t...
react native firebase 🔥 Version mismatch causing app termination
Looks like GoogleAppMeasurement gets imported as a dependency with version 5.3.0 A simple addition t...
react native firebase onNotificationOpened not working on Android (background/foreground)
Solved the issue only on background using @ZardozSpeaks approach Under my ...
psycopg2 psycopg2-binary: Why?
But not all depends from me I use different third-party packages which already has psycopg2 or psyco...
react native firebase Firebase dependency updates are required to fix gradle v4+ builds
@DeepaSriramRR as a temporal workaround you can disable version check of the Google plugin At the en...
react native firebase AndroidX support
Play Services just shipped AndroidX breaking changes - if you must upgrade your android Firebase SDK...
react native firebase RNFirebase core module was not found natively on ios
I will just leave it here in case someone comes and it's still struggling with this ...
sheetjs Doesn't work with browserify or webpack.
I was able to get it building by adding the following to my webpack config: EDIT: please raise a new...
dbeaver Postgres connection error
@lcustodio on the SSL page set SSL mode: require and either leave the SSL Factory blank or use the o...
typeorm Relation decorators: allow to pass string instead of typeFunction
PR is submitted As an example Issue type: [ ] question [ ] bug report [x] feature request [ ] docume...
typeorm How to get foreign key for instance?
You can't do that because your group is relation object its not a simple number (id of the pricetagg...
typeorm MissingDriverError: Wrong driver: "undefined" given.
solved it by export the config this way in my ormconfig.ts: Issue type: [ ] question [X] bug report ...
dbal [2.10.0] Do not add CHARACTER SET for some column types
I solved my errors in the migration files adding ->charset(null) Bug Report Q A BC Break no Version ...
dbal Doctrine\DBAL\Exception\InvalidFieldNameException when working with DB schema on PostgreSQL 10
Suggested solution: PostgreSqlSchemaManager.php line 292: to : Since upgrading to PostgreSQL 10 I ha...
react native firebase [📚] AdMob - use @invertase/react-native-google-ads
Just FYI we're getting close here AdMob documentation availability Hi there! I've noticed that AdMob...
typeorm .save() is throwing duplicate key value violates unique constraint
I can confirm that this problem still exists I'm using typeorm with postgres. Issue type: [x] questi...
typeorm Error: Entity metadata was not found
I ran into the same issue TypeORM is very difficult to debug with args and meta data classes/collect...
react native firebase [SOLVED with v2.1.1] Undefined symbols for architecture x86_6: _OBJC_CLASS_$_RNFirebaseDatabaseReference
Okay.. if anybody comes accross this magic error try this It solved the problem (for now) Close Xcod...
typeorm WHERE, Date, and BETWEEN
It appears that there is a bug with how QueryBuilder is handling dates I only tested with SQLite ...
dbeaver Create a PPA for updating dbeaver under ubuntu
First DBeaver CE PPA is here: Usage: I...
efcore How to write DbFunction's translation?
@Kation You actually does not need so much of code to use JSON_VALUE function Based on documentation...
react native firebase [android] No Firebase app '[DEFAULT]' has been created - call firebase.initializeApp(), js engine: hermes
I spent a lot of hours for found who was the problem most setup issues such as default app has not b...
efcore Inheritance problem with DbContext subclasses requiring constructor to supply DbContextOptions<DerivedContext>
I was able to resolve this without a hack by providing a protected constructor that uses DbContextOp...
react native firebase iOS: Firebase.h not found
Can you first close xcode then delete the xcworkspace & Podfile.lock files in the ios directory then...
react native firebase Android: JDK 10 not supported for v4.1.0
+1 4.1.0 broke builds for Java10 As a temporary workaround on MacOS Issue Upon upgrading to v4.1.0 a...