Since you are using RVM to manage your Ruby versions,as you told in the comments, there is an easy solution: creating a private bundle for this application and install only the version of the gem you need in this bundle.
This is how you may do it:
1) Enter the directory of your application;
2) Type the following command
rvm use ruby-2.4.0@your_app_name --ruby-version --create
(I am assuming you are using Ruby 2.4.0. If this is not your version, replace it accordingly in the command above, please.)
3) Install bundler gem
gem install bundler
4) Make sure your Gemfile declares the version of the gem you need. In this case it must have the line:
gem "json", "1.8.6"
5) Now run
bundle install
And you are done!
WARNING: This procedure will make sure the json gem
will be version 1.8.6. But you may have problems with your bundle install
if some other gem installed requires a newer version of json gem
. In this case you'll have to solve this conflict some other way.
To learn more about different bundles for different applications, read this.
I hope this helps.