我在 centos6.4 中通过 yum -y install ruby rubygems 安装了 ruby 和 rubygems,然后再通过 gem install fpm,发现出错,google 了一圈,只找到要更换成 taobao 源的方案,于是:
*** CURRENT SOURCES ***
再然后:
出现以下错误:
...
Exception Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File exists - /usr/lib/r
uby/gems/1.8/gems/json-1.8.1/tests
Building native extensions. This could take a while...
Exception
Gem::InstallError' at /usr/lib/ruby/site_ruby/1.8/rubygems/ext/builder.rb:49 -
extconf failed:
/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Exception `Gem::Installer::ExtensionBuildError' at /usr/lib/ruby/site_ruby/1.8/rubygems/in staller.rb:483 - 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/lib/ruby/gems/1.8/gems/json-1.8.1 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/gem_make.o ut
ERROR: Error installing fpm: 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/lib/ruby/gems/1.8/gems/json-1.8.1 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/gem_make.o ut
怎么解决?我只想装 fpm 而已。
实际上,我昨天另外一个虚拟机 debian7 中,是可以直接 gem install fpm 的,都不需要更改 sources。