我在centos6.4中通过yum -y install ruby rubygems
安装了ruby和rubygems,然后再通过gem install fpm,发现出错,google了一圈,只找到要更换成taobao源的方案,于是:
# gem sources --remove
http://rubygems.org/# gem sources -a
http://ruby.taobao.org/# gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org/再然后:
# gem install fpm
出现一下错误:
...
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。