json - 安装 json 时出错 : Failed to build gem native extension

标签 json rubygems

花了一些时间弄清楚这个:

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”。

最佳答案

解决方案:

sudo apt-get install libgmp-dev

关于json - 安装 json 时出错 : Failed to build gem native extension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32135635/

相关文章:

json - Postgres JSON 数据类型 Rails 查询

ruby-on-rails - debugger-ruby_core_source gem 没有提供 ruby​​-2.0.0-p451 的源代码

ruby - 如何使用 ruby​​ 的 mkmf 链接到外部 c 库?

ruby-on-rails - rake 任务中使用错误的 ruby​​ 路径作为 cron 执行,无论何时

ruby - 巨大的 json 对象要出类拔萃?

import - 将博客导入Jekyll-这是什么加载错误 'require cannot load such file'?

android - 从 JSON Web 服务加载数据并将其显示在 ListView 中

javascript - 如何将json中的每个数据推送到angularjs中的每个数组中

json - 'dict' 对象在 Django Serializer 上没有属性 '_meta'

python - 如何从 django 模板在 html 页面上打印漂亮的 JSON?