Rahul
Rahul

Reputation: 181

Bundler attempted to update rails but its version stayed the same

I'm trying to update the rails 5.0.7 to 5.2 but it is showing that

Bundler attempted to update rails but its version stayed the same

the command which I tried to update are:-

rails app:update

but it is not updating the rails even I tried running the below code

bundle update rails

Upvotes: 11

Views: 23368

Answers (3)

mpoisot
mpoisot

Reputation: 8111

I ran into a similar issue trying to update a few stubborn gems. I recommend the standalone gem bundler-stats for figuring out what bundler is thinking, especially bundle-stats versions SOME_GEM_NAME. For more info check out this blog post.

Upvotes: 4

Semih Arslanoglu
Semih Arslanoglu

Reputation: 1139

For people who came here to update their regular gem in my case I was trying to update

gem 'listen', '>= 3.0.5', '< 3.2'

this gem to version 3.2.1

It was limited with 3.2 so basically change it to

gem 'listen', '>= 3.0.5', '< 3.3'

please before updating version always look your gemfile.lock if there is blocking dependencies.

Upvotes: 8

Paulo Fidalgo
Paulo Fidalgo

Reputation: 22331

This can mean one of two things:

  1. You have a dependency for rails (a package that depends on rails in a version < 5.2
  2. You have specified a version for the rails (or it's gems) in your Gemfile, like gem 'rails', '~> 5.0.6' or gem 'activerecord', '5.0'

On a side note, when updating rails, do not upgrade from 5.0 to 5.2, follow the upgrading guides at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html and do an incremental upgrade (one version at a time)

Upvotes: 4

Related Questions