title: RoR - Bundler could not find compatible versions for gem
body: <p>I am working on Ruby on Rails application. I am trying to upgrade the rails version from 4.2 to 5.0</p>
  <p>I have changed the rails dependency in engine's gemspec file.</p>
  <p>On running <code>bundle update</code> in engine it is showing the following error -</p>
  <pre><code>Bundler could not find compatible versions for gem &quot;actionmailer&quot;:
    In Gemfile:
      engine was resolved to 0.0.1, which depends on
        rails (~&gt; 5.0) was resolved to 5.2.4.4, which depends on
          actionmailer (= 5.2.4.4)
  
      simple_token_authentication was resolved to 1.17.0, which depends on
        actionmailer (&gt;= 3.2.6, &lt; 7)
  
  Bundler could not find compatible versions for gem &quot;actionpack&quot;:
    In Gemfile:
      engine was resolved to 0.0.1, which depends on
        rails (~&gt; 5.0) was resolved to 5.2.4.4, which depends on
          actionpack (= 5.2.4.4)
  
      rspec-rails was resolved to 4.0.2, which depends on
        actionpack (&gt;= 4.2)
  
      simple_token_authentication was resolved to 1.17.0, which depends on
        actionpack (&gt;= 3.2.6, &lt; 7)
  
  Bundler could not find compatible versions for gem &quot;activerecord&quot;:
    In Gemfile:
      paranoia (~&gt; 2.2) was resolved to 2.4.3, which depends on
        activerecord (&gt;= 4.0, &lt; 6.2)
  
      engine was resolved to 0.0.1, which depends on
        rails (~&gt; 5.0) was resolved to 5.2.4.4, which depends on
          activerecord (= 5.2.4.4)
  
  Bundler could not find compatible versions for gem &quot;activesupport&quot;:
    In Gemfile:
      factory_girl_rails was resolved to 4.9.0, which depends on
        factory_girl (~&gt; 4.9.0) was resolved to 4.9.0, which depends on
          activesupport (&gt;= 3.0.0)
  
      engine was resolved to 0.0.1, which depends on
        rails (~&gt; 5.0) was resolved to 5.2.4.4, which depends on
          activesupport (= 5.2.4.4)
  
      rspec-rails was resolved to 4.0.2, which depends on
        activesupport (&gt;= 4.2)
  
  Bundler could not find compatible versions for gem &quot;rails&quot;:
    In Gemfile:
      engine was resolved to 0.0.1, which depends on
        activeadmin (= 1.0.0.pre2) was resolved to 1.0.0.pre2, which depends on
          rails (&gt;= 3.2, &lt; 5.0)
  
      engine was resolved to 0.0.1, which depends on
        rails (~&gt; 5.0)
  
  Bundler could not find compatible versions for gem &quot;railties&quot;:
    In Gemfile:
      factory_girl_rails was resolved to 4.9.0, which depends on
        railties (&gt;= 3.0.0)
  
      engine was resolved to 0.0.1, which depends on
        rails (~&gt; 5.0) was resolved to 5.2.4.4, which depends on
          railties (= 5.2.4.4)
  
      rspec-rails was resolved to 4.0.2, which depends on
        railties (&gt;= 4.2)
  </code></pre>
  <p>I tried to delete gemfile.lock of engine and run command <code>bundle install</code> then it is showing the following error -</p>
  <pre><code>Bundler could not find compatible versions for gem &quot;rails&quot;:
    In Gemfile:
      engine was resolved to 0.0.1, which depends on
        activeadmin (= 1.0.0.pre2) was resolved to 1.0.0.pre2, which depends on
          rails (&gt;= 3.2, &lt; 5.0)
  
      engine1 was resolved to 0.0.1, which depends on
        engine2 was resolved to 0.0.1, which depends on
          rails (~&gt; 5.0)
  </code></pre>
  <p>Do anyone have any idea how to resolve it? Please help!</p>