Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle update not working correctly

This is the error I'm getting with bundle update:

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 (< 5.0, >= 4.0.0)

rails (~> 5.2) was resolved to 5.2.0, which depends on
  railties (= 5.2.0)

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

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

I tried to check my rails -v and it told me to run bundle update and when I did, I got this error. Can anyone help ? I'm quite lost

like image 292
digital king Avatar asked May 09 '26 20:05

digital king


1 Answers

This error occurs because Bundler attempts to satisfy the version requirements of the dependencies, but is unable to do so as rails 5.2.0 requires the gem railties in the version 5.2.0, while coffee-rails 4.1.0 needs a version of railties which is less than 5.0 but greater than or equal 4.0.0. Those two requirements are conflicting with each other.

Luckily, solving that problem is really easy: all you need to do is to bump the version requirement of the coffee-rails gem to ~> 4.2. This can be done by changing the line gem "coffee-rails", "~> 4.1.0" (or similar) in your Gemfile to the following:

gem "coffee-rails", "~> 4.2"

After that change, bundle update should work just fine.

like image 60
Jyrki Avatar answered May 11 '26 08:05

Jyrki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!