最佳答案
作为上下文,它位于具有防火墙的远程服务器上。我正在通过代理设置环境。我有ruby 1.8.7
。当我尝试gem安装..
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。
如何安装json gem-未能建立gem本地扩展这似乎是略有不同的错误。
有提示吗?谢谢!