title: Ruby On Rails: Bundler could not find compatible versions for gem "json"
body: <p>I did search and none of the existing solutions worked for me, so I created a new question.</p>
  
  <p>Got an error trying to launch the server.</p>
  
  <blockquote>
    <p>Bundler could not find compatible versions for gem "json":<br>
    In snapshot (Gemfile.lock):<br>
    json (= 1.8.6)  </p>
    
    <p>In Gemfile: rails (= 4.2.4) x86-mingw32 was resolved to 4.2.4,<br>
    which depends on
    activesupport (= 4.2.4) x86-mingw32 was resolved to 4.2.4,<br>
    which depends on json (>= 1.7.7, ~> 1.7) x86-mingw32</p>
  </blockquote>
  
  <p>Gemfile
       source '<a href="https://rubygems.org" rel="nofollow noreferrer">https://rubygems.org</a>'</p>
  
  <pre><code> gem 'rails', '4.2.4'
   gem 'activerecord-jdbcpostgresql-adapter'
   gem 'sass-rails', '~&gt; 5.0'
   gem 'uglifier', '&gt;= 1.3.0'
   gem 'coffee-rails', '~&gt; 4.1.0'
   gem 'therubyrhino'
   gem 'jquery-rails'
   gem 'jbuilder', '~&gt; 2.0'
   gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>Gemfile.lock fragment</p>
  
  <pre><code> GEM
     remote: https://rubygems.org/
     specs:
    activesupport (4.2.4)
         i18n (~&gt; 0.7)
         json (~&gt; 1.7, &gt;= 1.7.7)
         minitest (~&gt; 5.1)
         thread_safe (~&gt; 0.3, &gt;= 0.3.4)
         tzinfo (~&gt; 1.1)
  
    json (1.8.6-java)
  </code></pre>
  
  <p>What I tried to do:</p>
  
  <ul>
  <li><p>Delete Gemfile.lock and run bundle install</p></li>
  <li><p>Add json to Gemfile</p></li>
  <li><p>Set both json in Gemfile.lock to 1.8.6-java</p></li>
  </ul>
  
  <blockquote>
    <p>Bundler could not find compatible versions for gem "json":    In
    snapshot (Gemfile.lock):<br>
    json (= 1.8.6)  </p>
    
    <p>In Gemfile:<br>
    rails (= 4.2.4) x86-mingw32 was resolved to 4.2.4,<br>
    which depends on activesupport (= 4.2.4) x86-mingw32 was resolved to 4.2.4,<br>
    which depends on   json (= 1.8.6) x86-mingw32</p>
  </blockquote>
  
  <p>Delete json (1.8.6-java)  from Gemfile.lock</p>
  
  <p>None of these worked.</p>