Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 770
Rahul Avatar asked Apr 28 '18 09:04

Rahul


3 Answers

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.

like image 65
Semih Arslanoglu Avatar answered Oct 10 '22 08:10

Semih Arslanoglu


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)

like image 4
Paulo Fidalgo Avatar answered Oct 10 '22 10:10

Paulo Fidalgo


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.

like image 3
mpoisot Avatar answered Oct 10 '22 09:10

mpoisot