mkp24
mkp24

Reputation: 125

Giving error on rails bundle install

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.

In Gemfile:

rails was resolved to 4.2.6, which depends on

actionmailer was resolved to 4.2.6, which depends on
  actionpack was resolved to 4.2.6, which depends on
    actionview was resolved to 4.2.6, which depends on
      rails-dom-testing was resolved to 1.0.9, which depends on
        rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
          activesupport was resolved to 4.2.6, which depends on
            json

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/bundler20180201-46774-s2jlm4json-1.8.6/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20180201-46774-16pojxx.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

what does this mean and how to correct it.I have already tried update and upgrade method is there any other ways to remove certain dependencies.

Upvotes: 0

Views: 493

Answers (2)

Pragya Sriharsh
Pragya Sriharsh

Reputation: 559

Try this:

bundle update

In case of bundler error

gem install bundler  #After that run below command too.

bundle install

Upvotes: 0

mkp24
mkp24

Reputation: 125

Try to update source list if necessary otherwise remove most of the files installed recently and then do a fresh install from the beginning. Installed each held packages separately if needed other wise

sudo apt-get uprade 

will also work.

Upvotes: 0

Related Questions