When I try to install gems like ohai and fpm on my Amazon Linux EC2 instance I get the error message:
[ec2-user@ip-172-31-43-16 ~]$ sudo gem install ohai
Building native extensions. This could take a while...
ERROR: Error installing ohai:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 extconf.rb
Gem files will remain installed in /usr/local/share/ruby/gems/2.0/gems/ffi-1.9.6 for inspection.
Results logged to /usr/local/share/ruby/gems/2.0/gems/ffi-1.9.6/ext/ffi_c/gem_make.out
That's it, no additional hints. The message is identical with fpm.
I've Googled and have done everything that I think I'm supposed to do. I have yum installed gcc, make, install, ruby-devel - in fact in a fit of trying everything I yum installed everything ruby20*, rubygem[s]20*, etc. and yum updated the hell out of my whole system. I have done a gem update --system.
I was able to gem install facter, which doesn't build a native extension, so the rest of Rubyville seems fine.
There's a similar question and answer over here: https://github.com/sj26/mailcatcher/issues/144
In that case it came to a suggestion to reinstall ruby and that worked YMMV. In that case build-essentials was an important item checked for along the way (Ubuntu system, not CentOS). I gather the CentOS equivalent is
yum groupinstall "Development Tools"