Error installing json 1.8.3 with ruby 2.4

Problem

You are trying to install the gems for your rails application in a new computer, or by using ruby 2.4 and you get the following error:

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

Solution

Remove your old Gemfile.lock file and run bundle again. A newer version of json (ie 1.8.6) should be installed.