json 1.8.2 gem给我致命错误stdio.h

时间:2015-03-26 17:29:26

标签: ruby-on-rails ruby bundler

尝试安装

gem install json -v '1.8.2'

(.. bundle install gem 'json', '1.8.2'中的Gemfile

...在Ubuntu 14.04 VM上给了我:

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

    /home/deploy/.rbenv/versions/2.1.5/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from /home/deploy/.rbenv/versions/2.1.5/include/ruby-2.1.0/ruby/ruby.h:29:0,
                 from /home/deploy/.rbenv/versions/2.1.5/include/ruby-2.1.0/ruby.h:33,
                 from ../fbuffer/fbuffer.h:5,
                 from generator.c:1:
/home/deploy/.rbenv/versions/2.1.5/include/ruby-2.1.0/ruby/defines.h:26:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^

1 个答案:

答案 0 :(得分:4)

sudo apt-get install libc6-dev

修好了