0
/usr/bin/ruby1.9.1 extconf.rb /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from extconf.rb:1:in `<main>' Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.6 for inspection. Results logged to /var/lib/gems/1.9.1/gems/json-1.8.6/ext/json/ext/generator/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. 

In Gemfile:

 coffee-rails was resolved to 3.2.2, which depends on railties was resolved to 3.2.16, which depends on rdoc was resolved to 3.12.2, which depends on json 

Getting this error while running rails s.How to resolve it

4
  • 1
    Possible duplicate of Why won't bundler install JSON gem? Commented Jan 29, 2018 at 8:07
  • 1
    You have not installed all gems yet. bundle install broke along the way. Re-run bundle install and place the full error stack trace here. Commented Jan 29, 2018 at 8:11
  • on running gem install json -v '1.8.6'. getting an error: ERROR: Error installing json: ERROR: Failed to build gem native extension. current directory: /var/lib/gems/2.4.0/gems/json-1.8.6/ext/json/ext/generator /usr/bin/ruby2.4 -r ./siteconf20180129-18806-bb4juz.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.4.0/gems/json-1.8.6 for inspection. Results logged to /var/lib/gems/2.4.0/extensions/x86-linux/2.4.0/json-1.8.6/gem_make.out Commented Jan 29, 2018 at 8:29
  • ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /var/lib/gems/2.4.0/gems/json-1.8.6/tests/test_json.rb Commented Jan 29, 2018 at 8:34

1 Answer 1

0

commenting the content of gemfile and updating ruby and rails to a latest stable version will solve most of the errors. for me I reinstalled ruby and rails using the steps provided at:

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.