Error: Error Installing JSON: Error: Failed to Build Gem Native Extension

How to install json gem - Failed to build gem native extension(mac 10.10)

Sad, however, JSON-1.7.7 (and upto 1.8.1) is incompatible with Ruby-2.2.x. As you are using Ruby-2.2.1, it will not work for you.

There are 2 options for you:

  1. Update your json gem to 1.8.2 version. -- Preferable
  2. Edit ruby-2.2.1/ext/json/fbuffer/fbuffer.h file and replace problematic code with VALUE result = rb_str_new(FBUFFER_PTR(fb), FBUFFER_LEN(fb));. Look here for details

Error installing json 1.8.3 with ruby 2.4

I ran into the same issue recently as well, try and see if there's a newer version of whatever gem you're using that depends on json 1.8.3. This is happening because Ruby 2.4 unified Fixnum and Bignum into Integer. If you're able to upgrade to json 1.8.5 or higher, it should help fix your problems.

You could also try and update the gem you're using and try to relax the version constraints (I've found this to work with a lot of projects, but not all) like so:

gem 'json', '>= 1.8'

Could not install json.Error occurs in windows.ERROR: Error installing json:ERROR: Failed to build gem native extension

I have re installed ruby and devkit ,now its working fine.Thanks for your comments.



Related Topics



Leave a reply



Submit