Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

on amazon linux

Phenomenon
$ bundle install --path=vendor/bundle
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.0 extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/ruby/include/ruby.h


Gem files will remain installed in /home/ec2-user/aws-sdk/vendor/bundle/ruby/2.0/gems/json-1.8.2 for inspection.
Results logged to /home/ec2-user/aws-sdk/vendor/bundle/ruby/2.0/gems/json-1.8.2/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.
Solution

install ruby-devel

$ sudo yum install ruby-devel