1

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.

7
  • Did you actually look at the log file? Commented Oct 22, 2014 at 21:04
  • Yeah gem_make.out just says "/usr/bin/ruby2.0 extconf.rb". Or is there some other one I don't know about? Commented Oct 22, 2014 at 21:14
  • Really? That's the entire contents of the file?! Commented Oct 22, 2014 at 21:25
  • Yep. Alas. Not a lot to go on I know. Commented Oct 22, 2014 at 21:27
  • I got a little farther, an explicit gem install ffi got that in and then it errored on libyajl2, I gem installed that explicitly, then it is failing on ffi-yajl and I can't get that to install by itself. Still jack in the log file. Commented Oct 22, 2014 at 21:29

1 Answer 1

1

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"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.