Rails Upgrade 4.2 -> 5 - Bundler not able to resolve exact gem version

646 views Asked by At

I'm getting this error in upgrading various gems, as I'm trying to move from 4.2.11.1 to 5.0.1. Sample error for actionpack:

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    rails (= 5.0.1) was resolved to 5.0.1, which depends on
      actionpack (= 5.0.1)

    simple_form (= 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (>= 5.0)

    twitter-bootstrap-rails (= 4.0.0) was resolved to 4.0.0, which depends on
      actionpack (~> 5.0, >= 5.0.1)

As far as my understanding is concerned about gem versions, this should not be an error, as version 5.0.1 satisfies all the dependencies. Can someone explain how can I get rid of such errors? I'm getting many such errors while upgrading

1

There are 1 answers

6
Deepak Mahakale On

This is a tedious task and won't always be as easy.

I would suggest you follow this approach:

  1. Try deleting the Gemfile.lock also try to remove the gem versions from Gemfile if possible unless you specifically need the version. (you might want to keep version of rails, devise, aasm locked as there might be some major changes)
  2. Run bundle install
  3. At this step there are still chances you might get some conflicts in versions and dependencies
  4. You will have to open and check the specific gems for the dependencies