Home Gem dependencies incompatibality during upgrade of rails 4.2.10 to rails 5.0.0
Reply: 2

Gem dependencies incompatibality during upgrade of rails 4.2.10 to rails 5.0.0

Swaps
1#
Swaps Published in 2017-12-04 14:57:52Z

I am in a middle of a process of upgrading our rails 4 app. Following the rails upgrade guide, I have updated current rails version in a gemfile replacing 4.2.10 with 5.0.0.

But after running bundle update rails, I am getting many incompatibility issues even after running 4.2.10 (with rails 4.2.10) which should update all gems to the latest version.

Following are the compatibility errors I am getting after running bundle update rails with rails 5.0.0 in a gemfile:

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    active_link_to was resolved to 1.0.3, which depends on
      actionpack

    active_model_serializers was resolved to 0.10.2, which depends on
      actionpack (< 6, >= 4.1)

    inherited_resources was resolved to 1.6.0, which depends on
      actionpack (< 5, >= 3.2)

    inherited_resources was resolved to 1.6.0, which depends on
      actionpack (< 5, >= 3.2)

    kaminari was resolved to 0.17.0, which depends on
      actionpack (>= 3.0.0)

    rails (= 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0)

    rails (= 5.0.0) was resolved to 5.0.0, which depends on
      actionpack (= 5.0.0)

    rspec-rails (= 3.6.0) was resolved to 3.6.0, which depends on
      actionpack (>= 3.0)
maguri
2#
maguri Reply to 2017-12-04 15:21:05Z

What is your question?

Before update a gem you have to check if your project code and dependencies are ready for this changes, not an easy process if this is a big app.

1. Come back to de rails version you had.

gem install <gem> -v=<version>

e.g.

gem install rails -v=4.2

This way your rails app should use the version you want.

2. Update the rest of the gems... (not recommend it if you are not sure about the new releases)

Check your Gemfile.lock:

bundle update

Or delete your Gemfile.lock (it will be rebuild automatically when you try to start your rails app).

Swaps
3#
Swaps Reply to 2017-12-05 13:35:28Z

Finally after many trials & testing, I was able to run bundle install. Listing steps that I tried-

1. Create a new demo rails app using rails new with rails 5.

2. Remove existing Gemfile.lock.

3. Remove all current gems: (I used for i in gem list --no-versions; do gem uninstall -aIx $i; done command referenced from here.)

4. Replace existing Gemfile with the new one that was generated from creating new rails 5 app. (assuming you'll be having a backup copy of existing Gemfile.)

5. Copy individual gems from old file to the new one.

6. Run bundle install. (You should be having a :) after this execution.)

7. Run rails app:update to continue with the upgrade process.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.335741 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO