1

Trying to update a Rails 4.2.9 app to Rails 5.2.1. Changed the Gemfile:

gem 'rails', '5.2.1'

But Bundler appears to not be able to find an appropriate version of ActiveModel (which is not specifically called out anywhere in the Gemfile).

I have updated the gems mentioned below to their most current versions (active_model_serializers, clearance, simple_form, sanitize, and capybara-angular (to 0.2.5 as 0.2.6 is breaking specs) and tests passing under 4.2.9).

Not sure how to approach this. Thoughts?

$ bundle update rails
  ...
  Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    active_model_serializers (= 0.10.7) was resolved to 0.10.7, which depends on
      activemodel (< 6, >= 4.1)

    clearance (= 1.16.1) was resolved to 1.16.1, which depends on
      email_validator (~> 1.4) was resolved to 1.6.0, which depends on
        activemodel

    rails (= 5.2.1) was resolved to 5.2.1, which depends on
      activemodel (= 5.2.1)

    simple_form (= 3.5.1) was resolved to 3.5.1, which depends on
      activemodel (< 5.2, > 4)

Bundler could not find compatible versions for gem "nokogiri":
  In Gemfile:
    nokogiri (= 1.7.2)

    capybara-angular (= 0.2.5) was resolved to 0.2.5, which depends on
      capybara (>= 2.5.0) was resolved to 2.18.0, which depends on
        nokogiri (>= 1.3.3)

    sanitize (= 4.6.6) was resolved to 4.6.6, which depends on
      nokogumbo (~> 1.4) was resolved to 1.5.0, which depends on
        nokogiri

    sanitize (= 4.6.6) was resolved to 4.6.6, which depends on
      nokogiri (>= 1.4.4)

    capybara-angular (= 0.2.5) was resolved to 0.2.5, which depends on
      capybara (>= 2.5.0) was resolved to 2.18.0, which depends on
        xpath (< 4.0, >= 2.0) was resolved to 2.1.0, which depends on
Meltemi
  • 37,979
  • 50
  • 195
  • 293
  • Did you try getting a fresh copy of your gemset with `gem pristine --all`? – ruby_newbie Oct 26 '18 at 23:06
  • 1
    simple_form is requiring version lower than 5.2 and rails is requiring version 5.2.1, check simple_form docs, maybe you need to update both rails and simple_form – arieljuod Oct 26 '18 at 23:10

1 Answers1

0

You're using simple_form version 3.5.1 and Rails 5.2.1. The first version of simple_form to support Rails 5.2 was version 4.0.

You can tell that this is the issue because of this line:

simple_form (= 3.5.1) was resolved to 3.5.1, which depends on
  activemodel (< 5.2, > 4)

Upgrade simple_form to at least version 4.0.0 and it should resolve the issue.

Most gem repositories will include a CHANGELOG that documents compatibility issues like this, so a good first step is to visit the repo for the gem to check that you have the latest version. (or at least a compatible one)

anothermh
  • 9,815
  • 3
  • 33
  • 52