Gem incompatibilities reported by bundler don't make logical sense - ruby-on-rails

I'm trying to update a rails app from version 5.2 to 6. I'm getting bizarre error messages from bundler.
When I change the rails version in my gemfile to 6 and then run bundle update I get a series of messages like the following:
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
rails (= 6.0) was resolved to 6.0.0, which depends on
activerecord (= 6.0.0)
seed_dump was resolved to 3.3.1, which depends on
activerecord (>= 4)
Since seed_dump depends on any version of activerecord greater than 4, why doesn't bundle consider version 6 compatible?
What can I do to get bundle update to run?

Following the advice in one of the comments, above, I fixed this problem by removing the line BUNDLED_WITH from Gemfile.lock. After removing the line, running bundle update ran without issue.

Related

Rails Upgrade 4.2 -> 5 - Bundler not able to resolve exact gem version

I'm getting this error in upgrading various gems, as I'm trying to move from 4.2.11.1 to 5.0.1. Sample error for actionpack:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (= 5.0.1) was resolved to 5.0.1, which depends on
actionpack (= 5.0.1)
simple_form (= 5.0.0) was resolved to 5.0.0, which depends on
actionpack (>= 5.0)
twitter-bootstrap-rails (= 4.0.0) was resolved to 4.0.0, which depends on
actionpack (~> 5.0, >= 5.0.1)
As far as my understanding is concerned about gem versions, this should not be an error, as version 5.0.1 satisfies all the dependencies. Can someone explain how can I get rid of such errors? I'm getting many such errors while upgrading
This is a tedious task and won't always be as easy.
I would suggest you follow this approach:
Try deleting the Gemfile.lock also try to remove the gem versions from Gemfile if possible unless you specifically need the version. (you might want to keep version of rails, devise, aasm locked as there might be some major changes)
Run bundle install
At this step there are still chances you might get some conflicts in versions and dependencies
You will have to open and check the specific gems for the dependencies

rails-portfolio gem not working with rails-5

i m using rails-portfolio my ruby version is 2.3.1 and rails version is 5.1.4
after adding gem 'rails-portfolio' and on running bundle install it gives following error:-
even on running bundle update is shows same error on console without any luck
Bundler could not find compatible versions for gem "rails": In
snapshot (Gemfile.lock):
rails (= 5.1.4)
In Gemfile:
rails (~> 5.1.4)
rails-portfolio (~> 0.0.5) was resolved to 0.0.5, which depends on
rails (~> 4.2)
Running bundle update will rebuild your snapshot from scratch, using
only the gems in your Gemfile, which may resolve the conflict.
You'll need to downgrade your Rails version, or you could fork the Gem, modify portfolio.gemspec to reflect your version and hope it acts as expected — a quick inspection indicates shows that there's nothing glaring obviously that would break.

How to fix 'could not find compatible version for gem "rails"'?

Im literaly bumping my head into a wall and I can not find a solution by myself about this problem.
I'm starting a project with Solidus , a Spree commerce fork. I played around with the gem for a litle while and now that I am ready to get serious and start to develop , I create a new project ad I'm bumping into this nasty error :
Bundler could not find compatible versions for gem "rails":
In snapshot (Gemfile.lock):
rails (= 5.1.2)
In Gemfile:
rails (~> 5.1.2)
solidus was resolved to 1.0.0, which depends on
solidus_core (= 1.0.0) was resolved to 1.0.0, which depends on
rails (~> 4.2.0)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
and bundle update is not solving my problem... I am running out of solution and will appreciate some hands in help in how to fix this problem.
Thanks
Bundler is doing you a favor here by showing you that you have incompatible version requirements for the rails gem.
You have rails (~> 5.1.2) listed in your gemfile and the solidus gem has a dependency on rails (~> 4.2.0), so there is a conflict about which version of rails your app should use.
Is there a reason you are using solidus version 1.0.0? It looks like the latest version of solidus is 2.0.2 at present. Later versions of solidus will have a more recent dependency listed for rails, which will allow your application to use rails 5+.
Update the version of solidus in your gemfile to something more recent and see if that allows bundler to install successfully.

Upgrading to Rails 5 problems - existing app

I recently tried to update to Rails 5 and it won't seem to work. I switched it over in my gemfile from 4.2.6 and deleted the gemfile.lock. I then ran gem update rails which seemed to work fine, but then I ran bundle update and I got these errors
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 5.0.0)
devise-heroku was resolved to 0.1.0, which depends on
rails (>= 3.1.1)
interactor-rails (~> 1.0) was resolved to 1.0.0, which depends on
rails (< 5, >= 3)
I can't seem to find much documentation on this. Any help would be great. Thanks
So, from the output you got, interactor-rails 1.0 does not support Rails 5. I checked out their page, and it looks like you need to bundle 2.0 version of that gem.
gem "interactor-rails", "~> 2.0"
You can read the docs here
You might need to upgrade the devise-heroku gem as well.

How to get around gem dependency?

I've been trying to add the make_flaggable gem to my Rails project and have been getting the following error.
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
make_flaggable (>= 0) ruby depends on
activerecord (< 4.2, >= 3.0) ruby
rails (= 4.2.1) ruby depends on
activerecord (4.2.1)
I've tried bundle update and installing the gems in differing order, but neither of these get around the real issue.
Is the best way to get around this to fork the Gem and make my own copy without the < 4.2 dependency? Or is there another way to install make_flaggable without moving to an older version of Rails?
In the meanwhile, I've found a fork maintained by dgilperez that supports Rails 4.2.
https://github.com/dgilperez/make_flaggable.
Both of these gems, however, I have been unable to install successfully and seem unmaintained.

Resources