Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install json - Ubuntu 14.04 - Rails

gem install json
Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    /home/user/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20150916-3216-1xudd6p.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [generator.so] Error 1

make failed, exit code 2

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.2.3/gems/json-1.8.3 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out

Hey. I'm trying to push to heroku but hit a dead end with this. First, there was the sqlit3 problem. Now, I'm unable to install json when I type bundle. What should I do now?

Thanks in advance.

like image 497
Aiyoyo Avatar asked Sep 16 '15 21:09

Aiyoyo


1 Answers

I had the same problem. You need to install libgmp-dev

Run sudo apt-get install libgmp-dev fix the problem.

like image 177
Wojtek Kosak Główczewski Avatar answered Nov 06 '22 16:11

Wojtek Kosak Główczewski