【发布时间】:2013-12-31 19:03:28
【问题描述】:
对于上下文,它位于具有防火墙的远程服务器上。我正在通过代理设置我的环境。我有ruby 1.8.7。当我尝试 gem install..
sudo gem install --http-proxy <host address>:<port> json
我收到以下错误:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/json-1.8.1 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
由于我不确定问题是什么,所以我搜索并找到了这些
gem install: Failed to build gem native extension (can't find header files) - 此处的说明似乎特定于正在安装的 gem。
How to install json gem - Failed to build gem native extension这似乎是略有不同的错误。
有什么提示吗?谢谢!
【问题讨论】:
-
检查
/usr/lib/ruby/ruby.h文件的存在,如果存在,向我们显示来自gem_make.out的错误消息。