如何安装json gem -构建gem本地扩展失败



我正在尝试部署rails应用程序到我的ubuntu linux服务器。我正在使用capistrano和bundler,当它安装gems时,它会失败,出现以下错误:

Installing json (1.7.7) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    /opt/ruby-enterprise-1.8.7-2012.02/bin/ruby extconf.rb 
creating Makefile
make
/usr/bin/gcc  -I. -I/opt/local/include -I/opt/ruby-enterprise-1.8.7- 2012.02/lib/ruby/1.8/i686-linux -I/opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64  -fPIC -g -O3   -Wall  -c parser.c
In file included from /usr/include/i386-linux-gnu/bits/posix1_lim.h:157:0,
             from /usr/include/limits.h:145,
             from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:169,
             from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/syslimits.h:7,
             from /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/limits.h:34,
             from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/1.8/i686-linux/ruby.h:95,
             from ../fbuffer/fbuffer.h:6,
             from parser.rl:1:
/usr/include/i386-linux-gnu/bits/local_lim.h:39:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [parser.o] Error 1

我正在运行ruby企业版1.8.7,如果没有大量的工作来升级其他站点,就无法升级ruby,所以现在这不是一个选择。我尝试了apt-get install ruby-dev,但它没有帮助(我不确定这是正确的事情)。

我认为你需要安装以下其中一个软件包:

$ apt-file search limits.h | grep 'linux/limits.h'
linux-headers-2.6.32-5-common: /usr/src/linux-headers-2.6.32-5-common/include/linux/limits.h
linux-headers-2.6.32-5-common-openvz: /usr/src/linux-headers-2.6.32-5-common-openvz/include/linux/limits.h
linux-headers-2.6.32-5-common-vserver: /usr/src/linux-headers-2.6.32-5-common-vserver/include/linux/limits.h
linux-headers-2.6.32-5-common-xen: /usr/src/linux-headers-2.6.32-5-common-xen/include/linux/limits.h
linux-libc-dev: /usr/include/linux/limits.h

相关内容

  • 没有找到相关文章

最新更新