2

I am trying to install rails and I am receiving the following error:

ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

/usr/bin/ruby2.2 -r ./siteconf20150420-9274-14pi84x.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.2.0/gems/json-1.8.2 for inspection.
Results logged to /var/lib/gems/2.2.0/extensions/x86_64-linux/2.2.0/json-1.8.2/gem_make.out

I have seen similar questions asked and answered but non seem to solve my problem

TheSabby
  • 267
  • 1
  • 3
  • 12
  • 2
    It can't find ruby sources. Have you installed `ruby-dev`? Try looking here http://stackoverflow.com/questions/20559255/error-while-installing-json-gem-mkmf-rb-cant-find-header-files-for-ruby – Oleg K. Apr 20 '15 at 20:41

1 Answers1

2

I had this same issue on my Ubuntu server. This article helped me out.

All I had to do is to install libgmp3-dev.

sudo apt-get install libgmp3-dev