Understanding version compatibility of gems with Rails 5 upgrade - ruby-on-rails

I'm trying to update my Rails app currently 4.1.4 using:
gem 'rails', '>= 5.0.0.rc2', '< 5.1'
After adding that to my gemfile and running bundle update rails
I get the message below (amongst other messages):
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
activerecord-session_store (~> 1.1.1) was resolved to 1.1.1, which depends on
actionpack (>= 4.0)
jquery-fileupload-rails (~> 0.4.7) was resolved to 0.4.7, which depends on
actionpack (>= 3.1)
rails (< 5.1, >= 5.0.0.rc2) was resolved to 5.0.0.rc2, which depends on
actionpack (= 5.0.0.rc2)
rspec-rails (~> 3.5.2) was resolved to 3.5.2, which depends on
actionpack (>= 3.0)
Is this saying, that rspec-rails is limiting the upgrade to 3.0? Is this compatible because it is saying that everything is rails 3.0 or greater? I'm trying to figure out what version it is telling me is conflicting the upgrade with this gem.
Please let me know.
Thanks!

Related

Bundler could not find compatible versions for gem. The version is within range

Bundler is giving this error when I run bundle install, but actionmailer 5.2.6 is within the range >= 5.2 and < 8! Why is it giving an error? It's doing this for multiple gems. The dependency is within range for all of them.
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
exception_notification (~> 4.2) was resolved to 4.5.0, which depends on
actionmailer (< 8, >= 5.2)
rails (~> 5.2.6) was resolved to 5.2.6, which depends on
actionmailer (= 5.2.6)
Here is an example of another nonsensical error. Obviously 5.0 <= 5.2.6 < 7:
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.2.6)
rails_admin (~> 2.0.1) was resolved to 2.0.2, which depends on
rails (>= 5.0, < 7)
I deleted Gemfile.lock. Bundler version 2.3.9. Gemfile
It was because of this line:
gem 'flip', '~>1.1', :git => 'https://github.com/pda/flip.git'
When commented, it works. When uncommented, it spits out nonsensical errors and buried in the errors is this:
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
flip (~> 1.1) was resolved to 1.1.1, which depends on
activesupport (>= 4.0, <= 5.2)
rails (~> 5.2.6) was resolved to 5.2.6, which depends on
activesupport (= 5.2.6)
I think that is the ONLY error it should have printed out, but that is probably a bug in Bundler. Now I must manually implement that Gem or think of a monkey patch. (I dislike unnecessary and superficial dependencies.)

RoR - Bundler could not find compatible versions for gem

I am working on Ruby on Rails application. I am trying to upgrade the rails version from 4.2 to 5.0
I have changed the rails dependency in engine's gemspec file.
On running bundle update in engine it is showing the following error -
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
engine was resolved to 0.0.1, which depends on
rails (~> 5.0) was resolved to 5.2.4.4, which depends on
actionmailer (= 5.2.4.4)
simple_token_authentication was resolved to 1.17.0, which depends on
actionmailer (>= 3.2.6, < 7)
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
engine was resolved to 0.0.1, which depends on
rails (~> 5.0) was resolved to 5.2.4.4, which depends on
actionpack (= 5.2.4.4)
rspec-rails was resolved to 4.0.2, which depends on
actionpack (>= 4.2)
simple_token_authentication was resolved to 1.17.0, which depends on
actionpack (>= 3.2.6, < 7)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
paranoia (~> 2.2) was resolved to 2.4.3, which depends on
activerecord (>= 4.0, < 6.2)
engine was resolved to 0.0.1, which depends on
rails (~> 5.0) was resolved to 5.2.4.4, which depends on
activerecord (= 5.2.4.4)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
factory_girl_rails was resolved to 4.9.0, which depends on
factory_girl (~> 4.9.0) was resolved to 4.9.0, which depends on
activesupport (>= 3.0.0)
engine was resolved to 0.0.1, which depends on
rails (~> 5.0) was resolved to 5.2.4.4, which depends on
activesupport (= 5.2.4.4)
rspec-rails was resolved to 4.0.2, which depends on
activesupport (>= 4.2)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
engine was resolved to 0.0.1, which depends on
activeadmin (= 1.0.0.pre2) was resolved to 1.0.0.pre2, which depends on
rails (>= 3.2, < 5.0)
engine was resolved to 0.0.1, which depends on
rails (~> 5.0)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
factory_girl_rails was resolved to 4.9.0, which depends on
railties (>= 3.0.0)
engine was resolved to 0.0.1, which depends on
rails (~> 5.0) was resolved to 5.2.4.4, which depends on
railties (= 5.2.4.4)
rspec-rails was resolved to 4.0.2, which depends on
railties (>= 4.2)
I tried to delete gemfile.lock of engine and run command bundle install then it is showing the following error -
Bundler could not find compatible versions for gem "rails":
In Gemfile:
engine was resolved to 0.0.1, which depends on
activeadmin (= 1.0.0.pre2) was resolved to 1.0.0.pre2, which depends on
rails (>= 3.2, < 5.0)
engine1 was resolved to 0.0.1, which depends on
engine2 was resolved to 0.0.1, which depends on
rails (~> 5.0)
Do anyone have any idea how to resolve it? Please help!
Re-read the error message, it says exactly what's going on.
Bundler could not find compatible versions for gem "rails":
There is no single version of rails that satisfies all requirements. From your issue description I see that you're trying to update to 5, so lets see what is not okay with 5.
In Gemfile:
engine was resolved to 0.0.1, which depends on
activeadmin (= 1.0.0.pre2)
Engine depends on activeadmin with a fixed version
was resolved to 1.0.0.pre2, which depends on
rails (>= 3.2, < 5.0)
This version requires rails of at least 3.2 and less than 5.0. This disallows rails 5. You'll need to update activeadmin in engine before you update rails in the application using the engine.

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
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.

Error while using rails_admin with rails5

I am trying to use rails_admin with rails5 application. rails_admin 0.8.1 didn't work because
Bundler could not find compatible versions for gem "rails": In
snapshot (Gemfile.lock):
rails (= 5.0.0.beta1)
In Gemfile:
rails (< 5.1, >= 5.0.0.beta1)
rails_admin was resolved to 0.8.1, which depends on
rails (~> 4.0)
Then I tried using the latest code from github by using
gem 'rails_admin', git: 'https://github.com/sferik/rails_admin.git'
Now I am getting conflicting rack dependicies.
In snapshot (Gemfile.lock):
rack (= 2.0.0.alpha)
In Gemfile:
rails (< 5.1, >= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
actionmailer (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
actionpack (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
rack (~> 2.x)
rails_admin was resolved to 0.8.1, which depends on
rack-pjax (~> 0.7) was resolved to 0.7.0, which depends on
rack (~> 1.3)
rails (< 5.1, >= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
sprockets-rails (>= 2.0.0) was resolved to 3.0.0, which depends on
sprockets (>= 3.0.0) was resolved to 3.5.2, which depends on
rack (< 3, > 1)
devise was resolved to 4.0.0.pre.dev, which depends on
warden (~> 1.2.3) was resolved to 1.2.4, which depends on
rack (>= 1.0)
devise was resolved to 4.0.0.pre.dev, which depends on
warden (~> 1.2.3) was resolved to 1.2.4, which depends on
rack (>= 1.0)
Is it too early to start using rails5? Should I go back to rails4.2?
I see that RA has Rails5 gemfile https://github.com/sferik/rails_admin/blob/master/gemfiles/rails_5.0.gemfile. I would try upgrading to all gems mentioned in that file.
I fixed by doing:
gem 'rails_admin', github: 'sferik/rails_admin'
gem 'rack-pjax', github: 'afcapel/rack-pjax'
gem 'remotipart', github: 'mshibuya/remotipart', ref: '3a6acb3'
see this article

sass-rails requires sprockets 2.0.0 but rails 4.1.0 requires sprockets 2.12.1 [duplicate]

This question already has answers here:
Updating from Rails 4.0 to 4.1 gives sass-rails railties version conflicts
(4 answers)
Closed 8 years ago.
I'm trying to upgrade my application from rails 3.2.16 to rails 4.1.0, I get into troubles right at the beginning when I try to call the bundler:
Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
sass-rails (>= 0) ruby depends on
sprockets (~> 2.0.0) ruby
rails (= 4.1.0) ruby depends on
sprockets-rails (~> 2.0) ruby depends on
sprockets (2.12.1)
Bundler could not find compatible versions for gem "sprockets-rails":
In Gemfile:
sass-rails (>= 0) ruby depends on
sprockets-rails (~> 2.0.0) ruby
rails (= 4.1.0) ruby depends on
sprockets-rails (2.1.3)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
sass-rails (>= 0) ruby depends on
railties (~> 3.1.0) ruby
rails (= 4.1.0) ruby depends on
railties (4.1.0)
and (part) of my Gemfile:
gem 'rails', '4.1.0'
gem 'mysql2'
gem "rake"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem 'sass-rails'
Some older versions of Bundler have a bug that can cause this failure to resolve. Updating to the latest version might help.
Run this to update:
gem install bundler

Resources