使用gem安装json时出错。无法构建gem原生扩展

时间:2015-04-20 20:29:32

标签: ruby json ruby-on-rails-4 gem

我正在尝试安装rails,但收到以下错误:

ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

/usr/bin/ruby2.2 -r ./siteconf20150420-9274-14pi84x.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.2.0/gems/json-1.8.2 for inspection.
Results logged to /var/lib/gems/2.2.0/extensions/x86_64-linux/2.2.0/json-1.8.2/gem_make.out

我已经看过类似的问题并回答了问题,但似乎没有解决我的问题

1 个答案:

答案 0 :(得分:2)

我在Ubuntu服务器上遇到了同样的问题。这article帮助了我。

我所要做的就是安装libgmp3-dev。

sudo apt-get install libgmp3-dev