1
votes

I'm trying to upgrade my rails 4.2 project to 5.2.3.

When executing bundle update rails, I got an following error.

Bundler could not find compatible versions for gem "faraday": In Gemfile: faraday (~> 0.11.0)

faraday_middleware was resolved to 0.13.1, which depends on
  faraday (>= 0.7.4, < 1.0)

oauth2 (~> 1.3.1) was resolved to 1.3.1, which depends on
  faraday (>= 0.8, < 0.12)

sentry-raven was resolved to 2.9.0, which depends on
  faraday (>= 0.7.6, < 1.0)

twilio-ruby was resolved to 5.23.1, which depends on
  faraday (~> 0.9)

Bundler could not find compatible versions for gem "railties": In Gemfile: coffee-rails (~> 4.1.0) was resolved to 4.1.0, which depends on railties (>= 4.0.0, < 5.0)

devise was resolved to 4.6.2, which depends on
  railties (>= 4.1.0, < 6.0)

factory_bot_rails was resolved to 5.0.2, which depends on
  railties (>= 4.2.0)

rails (= 5.2.3) was resolved to 5.2.3, which depends on
  railties (= 5.2.3)

rails-i18n was resolved to 5.1.3, which depends on
  railties (>= 5.0, < 6)

rspec-rails (~> 3.5, >= 3.5.2) was resolved to 3.8.2, which depends on
  railties (>= 3.0)

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

web-console (~> 2.0) was resolved to 2.3.0, which depends on
  railties (>= 4.0)

According to references, I deleted Gemfile.lock and ran bundle install but same error occurred.

It seems two gems are not compatible somehow with the current libraries. Do you have any suggestions how to safely upgrade rails project to 5.2.3?

1
Just delete Gemfile.lock and run bundle install again, probably it may help you.Anand
Hi as I commented above, it didn't work out, same message appeared.:(Sungpah Lee
Try running bundle update once, also if you have mentioned the gem version for any of gems above then remove it from the gemfile.Deepesh
This is really bad advice... Trying to upgrade a complex old rails application by "removing all version constraints, deleting Gemfile.lock, and running bundle update" will like introduce a huge number of errors. Sure, it will install the gems, but it's more than likely that the application won't actually run.Tom Lord
@SungpahLee Revert back to the working version of your application. Upgrade one thing at a time. Ensure that it still works, each step of the way. It seems to me that you've been trying to upgrade many things in one go, and - in doing so - you've edited the Gemfile to specify a higher version of the faraday which is incompatible with your other libraries.Tom Lord

1 Answers

0
votes

As I see you have 2 problems with gem dependencies:

1) You use faraday (~> 0.11.0), but twilio-ruby 5.23.1 need faraday (~> 0.9). So you need downgrade your faraday version to (~> 0.9)

2) You use coffee-rails (~> 4.1.0) which depends on railties (>= 4.0.0, < 5.0). But rails 5.2.3 use railties (5.2.3). So you need upgrade your coffee-rails to (~> 5.0.0)

By other words, in Gemfile you need change lines:

faraday (~> 0.11.0)
coffee-rails (~> 4.1.0)

To:

faraday (~> 0.9)
coffee-rails (~> 5.0.0)