Gem :: Ext :: BuildError: ERROR: Failed to create custom gem extension for rails version 4.2.6

I created a new rails app and try to run bundle install , it shows this error,

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/json-1.8.6/ext/json/ext/generator/usr/bin/ruby2.3 -r ./siteconf20170704-11395-12tpg5u.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.3.0/gems/json-1.8.6 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out

An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling

      

Please send me some suggestions, thanks in Advance.

+3


source to share


2 answers


If you have a Mac or Linux computer, try the following command:

sudo apt-get install ruby-dev

      

If that fails, what is your conclusion for:



gem install json -v '1.8.6'

      

(copy and paste all output).

A similar problem

+8


source


First, check the version of ruby and rvm . if rvm is not installed install rvm



0


source







All Articles