I can install other native extensions fine with rbenv's gem install. However, all servers (minus webrick) give me this problem:
Building native extensions. This could take a while...
ERROR: Error installing thin:
ERROR: Failed to build gem native extension. /custom_dir/.rbenv/versions/ruby-2.0.0-p247/bin/ruby extconf.rb
The output of gem_make.out is the same as the previous line. bundle install and bundle install --deployment work fine. The servers perform fine with bundle exec. However, I can't figure out why gem install puma|thin|etc fail. It's not important, but I'm wondering what is happening in case it's a symptom of another issue.
Another symptom: If I install thin or unicorn, I get the same error based on their dependencies. In other words, it tells me to look at kgio/gem_make.out or raindrops/gem_make.out, etc. However, if I install their dependenccies separatly: kgio, raindrops, etc., they install fine (using gem install kgio). But, when I try to install the final package, thin, unicorn, etc., it gives me the same error regarding ruby extconf.rb with no further details.
Another symptom: I can only compile Ruby 2.0 if I leave out rdoc/ri documentation. I get a make: *** [rdoc] Error 137 if I compile Ruby with documentation. I believe this is related to why the server gems won't compile. I have managed to install unicorn manually w/o Rubygems,, using Ruby 2.0.
Ruby 1.9. compiles fine, along with rdoc/ri documentation. puma and others install fine, even with rdoc/ri doc generation. So it seems it is a problem with:
- Ruby 2.0
- rdoc/ri generation
Update: Installing Ruby 2.0 with RVM (instead of rbenv) worked. Installing all other server gems works fine and the executables (eg puma) work fine. RVM seems to be doing something extra that rbenv/ruby-build is not.