Gem issues while upgrading to rails 5.1.1 - ruby-on-rails

I'm having gem issues when I tried to upgrade to rails 5.1.1, I get the the output below when I run bundle update rails from 4.2: Any ideas what the issue might be?
Bundler could not find compatible versions for gem "railties":
In Gemfile:
railties (~> 5.0)
devise was resolved to 4.3.0, which depends on
railties (< 5.2, >= 4.1.0)
quiet_assets (~> 1.1) was resolved to 1.1.0, which depends on
railties (< 5.0, >= 3.1)
rails (~> 5.1.1) was resolved to 5.1.1, which depends on
railties (= 5.1.1)
responders (~> 2.1) was resolved to 2.4.0, which depends on
railties (< 5.3, >= 4.2.0)

Think the problem may lie with railties (~> 5.0) , if you look a little further down then it states that Rails 5.1.1 needs Railties 5.1.1. rails (~> 5.1.1) was resolved to 5.1.1, which depends on
railties (= 5.1.1). On a side note, have you upgraded before? It may be worth upgrading from 4.2 to 5.0 and then 5.1 to make sure you catch any errors from deprecated methods. See this -> Rails Upgrade Guide
Edit to add:
Looks as though the quiet_assets gem is deprecated. If you need quiet_assets gem then check out this article on silencing asset-logging (explains it better than I can)! Quiet Assets in Rails 5

Related

Having issue while upgrading rails from 4.x to 5.x

I am having issues while upgrading rails versions. My ruby version is 2.6.3 and my current rail version is 4.2.1.
I tried with rake rails:update and rails app:update, but both of them gave me this error.
You have requested:
rails = 5.0.7.2
The bundle currently has rails locked at 4.2.11.2.
Try running `bundle update rails`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
Trying what was suggested in the error gave me this error.
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
ancestry was resolved to 3.2.1, which depends on
activerecord (>= 4.2.0)
annotate (~> 2.6.5) was resolved to 2.6.10, which depends on
activerecord (>= 3.2, <= 4.3)
globalize was resolved to 5.3.1, which depends on
activerecord (>= 4.2, < 6.1)
activeadmin was resolved to 1.0.0, which depends on
kaminari (>= 0.15, < 2.0) was resolved to 1.2.1, which depends on
kaminari-activerecord (= 1.2.1) was resolved to 1.2.1, which depends
on
activerecord
rails (= 5.0.0) was resolved to 5.0.0, which depends on
activerecord (= 5.0.0)
activeadmin was resolved to 1.0.0, which depends on
ransack (~> 1.3) was resolved to 1.8.4, which depends on
activerecord (>= 3.0)
seed_dump was resolved to 3.3.1, which depends on
activerecord (>= 4)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 5.0.0)
active_admin-sortable_tree was resolved to 1.0.0, which depends on
rails (>= 3.2)
My end goal is to upgrade rails 4.x to 6.x. I am going step by step by upgrading rails 4.x to 5.x and then 5.x to 6.x. I am not able to achieve the first phase i.e upgrading 4.x to 5.x.
Any help regarding how can I solve this issue would be much appreciated. Thanks.

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.

Upgrading rails from 5.0.2 to 5.1.0

I was trying to upgrade my current rails 5.0.2 version to the latest rails 5.1.0 version by running bundle update rails after adding gem 'rails', '~> 5.1' on my Gemfile and I got this error message.
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
rails (~> 5.1) was resolved to 5.1.0, which depends on
activejob (= 5.1.0) was resolved to 5.1.0, which depends on
globalid (>= 0.3.6) was resolved to 0.4.0, which depends on
activesupport (>= 4.2.0)
jbuilder (~> 2.5) was resolved to 2.6.1, which depends on
activesupport (< 5.1, >= 3.0.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
activesupport (= 5.1.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0) was resolved to 5.1.0, which depends on
rails-dom-testing (~> 2.0) was resolved to 2.0.2, which depends on
activesupport (< 6.0, >= 4.2.0)
rails (~> 5.1) was resolved to 5.1.0, which depends on
sprockets-rails (>= 2.0.0) was resolved to 3.2.0, which depends on
activesupport (>= 4.0)
This sounds like you need to try and upgrade to a newer version of jbuilder. However, looking at RubyGems the current dependancies for Jbuilder still say:
activesupport < 5.1, >= 3.0.0
IF this is the case, JBuilder doesn't yet support the more recent Activesupport, now required by Rails 5.1 - so perhaps JBuilder isn't yet available in Rails 5.1.
If you need to get the newer Rails, then you should probably consider:
Checking to see if there is a roadmap in JBuilder for this.
Raising a JBuilder ticket requesting support for that later Rails version.
You could try an override - since it may potentially just work, and that <5.1 is just since it's not yet been tested with the more recent version - just be prepared for glitches if there are genuine compatibility issues. I'd definitely rerun the whole of your test suite after trying that.
The alternative is to wait a little bit - this is a very fresh release - give other packages a chance to catch up with it.
Deleting Gemfile.lock then running bundle worked for me

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