scott.piligrim2018
scott.piligrim2018

Reputation: 129

When upgrading from rails 5.1 to 5.2, how do you update your Gemfile?

I'm trying to upgrade my rails application from 5.1.4 to 5.2.

I've gone through the steps here: https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-5-1-to-5-2.html

However, this completely skips over how to update your gemfile.

When I change

gem 'rails', '~> 5.1.4'

to

gem 'rails', '~> 5.2.2'

I receive the error:

Bundler could not find compatible versions for gem "activesupport":
  In snapshot (Gemfile.lock):
    activesupport (= 5.1.6.1)

  In Gemfile:
    rails (~> 5.2.2) was resolved to 5.2.2, which depends on
      activesupport (= 5.2.2)

    sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
      railties (>= 4.0.0, < 6) was resolved to 5.1.6.1, which depends on
        activesupport (= 5.1.6.1)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

I can resolve these errors, but this seems to be an incomplete way to update.

What is the proper way to update your gemfile?

Upvotes: 2

Views: 1722

Answers (1)

Igor Kasyanchuk
Igor Kasyanchuk

Reputation: 774

bundle update rails

after this you can use gem "bundleup" to see what other gems you can update.

Upvotes: 5

Related Questions