2015-08-21 96 views
2

花了一些时间搞清楚了这一个了这一点:错误安装JSON:无法建立宝石原生扩展

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/bin/ruby -r ./siteconf20150611-1112-jqgxzj.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 

这里最重要的行是“无法找到 - lgmp”。

回答

7

解决方案:

sudo apt-get install libgmp-dev 
相关问题