Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install json 1.8.3 in ruby 2.2.1

I am running bundle install in Ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] (installed with rvm 1.25.33) and bundler 1.10.6

When it tries to install json 1.8.3, I get the following:

Installing json 1.8.3 with native extensions

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

/home/andrew/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150905-31357-cgs3dn.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so

make "DESTDIR=" install
./install -m 0755 generator.so ./.gem.20150905-31357-199esvy/json/ext
make: ./install: Command not found
make: *** [install-so] Error 127

make install failed, exit code 2

On the same host, I am able to install json 1.8.3 in ruby 2.1.3.

In another SO question I see the suggestion to make sure that install is available. I get valid output when I do install --help.

What should I do? Why is the gem able to install in 2.1.3 and not 2.2.1?

like image 662
asfallows Avatar asked Sep 08 '15 14:09

asfallows


4 Answers

simple fix delete your gem.lock file and run bundle install this should rebuild the gemlock file and fix the issue, i was getting the same error when trying to move my development environment from nitrous.io to cloud9,. hope this help

copy from migs120's answer https://github.com/flori/json/issues/253

I use macOS sierra, it's work fine.

like image 139
Ernest Lee Avatar answered Oct 20 '22 12:10

Ernest Lee


I would suggest try this for MacOS,

bundle update json --conservative

It will resolve the error.

like image 42
shubham mishra Avatar answered Oct 20 '22 14:10

shubham mishra


Install the following package in ubuntu

sudo apt-get install libgmp3-dev

For more information https://github.com/flori/json/issues/253

like image 1
user1099939 Avatar answered Oct 20 '22 14:10

user1099939


In OSX, do the following

brew install coreutils
like image 1
Jonathan Wheeler Avatar answered Oct 20 '22 13:10

Jonathan Wheeler