Rails reporting error: Failed to build gem native extension
First, check if you have Xcode installed
Second, if you already have Xcode in your Mac, use this command:

CC=gcc rvm install-version



Example

CC=gcc rvm install-1.9.3


Reason for this error in Mac OS is that your Ruby is not able to get the C header files

Hope, this works on all the Macbook's.  

Its working on El Capitan, ruby 1.9.3, rails 3.2, mysql 5.7