我正在尝试将 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 但它没有帮助(我不确定这是不是正确的事情)。