Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occurred while installing json (1.8.6), and Bundler cannot continue

I tried to run the bundle install command and I got the following errors. After reading some stackoverflow posts, I also ran bundle update.

I am still getting the issue of json ~ 1.8.6 gem (I guess).

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. Here the issue is not getting installation done properly.

I tried installing gem separately.But still the problem exists.

like image 852
FAntony Avatar asked Mar 29 '18 11:03

FAntony


2 Answers

Older versions of json gem have some incompatibilities with newer ruby. Try to update json gem bundle update json

like image 103
kolas Avatar answered Oct 19 '22 10:10

kolas


This can be solved by doing the following

1. Installing the ruby development environment by running the following command(for Linux machines).

sudo apt-get install ruby
ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]' -dev

Read this post for more details.

2. Now install the json -v '1.8.6' gem by running the following command.

sudo gem install json -v '1.8.6'

This should solve the issue. Now try running bundle update and bundle install and it should work fine.

Thanks @TomLord and @Haider Ali for your inputs.

like image 31
FAntony Avatar answered Oct 19 '22 11:10

FAntony