Getting actionpack dependency issue - ruby-on-rails

While running bundle install or running any other command getting this issue
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
activerecord-session_store was resolved to 1.1.3, which depends on
actionpack (>= 5.2)
rails (~> 5.1.7) was resolved to 5.1.7, which depends on
actionpack (= 5.1.7)
I have multiple version installed in my machine.I have created the rails app using the specific version and getting this issue

Related

bundler cannot find a compatible version when I think it should

I get this message from Bundler
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (= 5.1.7) was resolved to 5.1.7, which depends on
actionpack (= 5.1.7)
simple_form was resolved to 5.0.3, which depends on
actionpack (>= 5.0)
Seems to me 5.1.7 should satisfy >=5.0 so actionpack 5.1.7 should be compatible.
What am I missing?

Upgrading Rails 5.1 to 5.2, can't find gem versions, but seems like all the requirements are met

Here's a fragment from the log.
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
active_model_serializers was resolved to 0.10.10, which depends on
actionpack (>= 4.1, < 6.1)
rails (= 5.2.4.1) was resolved to 5.2.4.1, which depends on
actionpack (= 5.2.4.1)
rails-controller-testing (= 0.1.1) was resolved to 0.1.1, which depends on
actionpack (~> 5.x)
I just don't get what exactly it is missing. From what I understand, actionpack 5.2.4.1 fits all of the requirements from other gems, but something is not happy. There are bunch of other gems that appear to have similar issues, where at least at the first glace there shouldn't be any conflicts.
Any suggestions on how to fix that?

Install Rails 6 - Bundler could not find compatible versions for gem actionpack

We want to prepare our app for Rails 6.
gem 'rails', git: 'https://github.com/rails/rails.git', tag: 'v6.0.0.beta2'
I ran bundle install.
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails was resolved to 6.0.0.beta2, which depends on
actionpack (= 6.0.0.beta2)
rails-controller-testing was resolved to 1.0.4, which depends on
actionpack (>= 5.0.1.x)
rspec-rails was resolved to 3.8.2, which depends on
actionpack (>= 3.0)
sprockets-rails (~> 3.2.1) was resolved to 3.2.1, which depends on
actionpack (>= 4.0)
Not sure how exactly to go forward (should I comment out all gems which are listed as problematic? It seems to me that all dependencies are are using >= operator - doesn't this mean that actionpack (= 6.0.0.beta2) should be OK too? Can I get some guidance?
I invested more time into this and learned how to solve those issues. I am pretty sure that I didn't post most important part of the output about dependencies.
Normally there are gems which are locked to some gem versions. You want to find them manually via output. Be careful about output like this:
gem_xyz was resolved to 3.8.2, which depends on
actionpack (< 3.0)
Then you can check whether there is a fix on specific Github branch for e.g. Rails 6 version and use the gem directly from that branch. Not super easy but you can go forward slowly and prepare you project to be Rails6 a little bit earlier ...
I had the same issue when I was trying to test 6.0.0.rc2. I solved by removing the gem minitest-rails-capybara from the Gemfile and by improving system tests according to
https://edgeguides.rubyonrails.org/testing.html
The issue is not with actionpack but the other gems you are trying to install, the versions are not compactible with actionpack (= 6.0.0.beta2)
rails-controller-testing was resolved to 1.0.4
rspec-rails was resolved to 3.8.2
sprockets-rails (~> 3.2.1) was resolved to 3.2.1
You need to find versions that are compactible with the version of your actionpack. The version of actionpack is determined by the version of rails you are using. I had similar experience with
rspec-rails (~>3.4.2) and,
factory_girl_rails (~>1.0.4)
Upgrading both resolves the issue.

Understanding version compatibility of gems with Rails 5 upgrade

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!

How to upgrade Rails 4.2.4 to Rails 5.1.0.rc1 API project

I've got a project that uses Rails 4.2.4, Mongoid 4 and I'd like to upgrade to Rails 5.1.0.rc1 and Mongoid 6.1.0.
I've followed the instructions [here] (http://railsapps.github.io/updating-rails.html) however when I run the command bundle update I get the following error:
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 5.1.0.rc1) was resolved to 5.1.0.rc1, which depends on
actionpack (= 5.1.0.rc1) was resolved to 5.1.0.rc1, which depends on
rack (~> 2.0)
sinatra (>= 1.3.0) was resolved to 1.3.0, which depends on
rack (~> 1.3)
Any ideas of why?

Resources