I'm trying to run bundle install and getting the following error:
Bundler could not find compatible versions for gem "activemodel": In
Gemfile:
rails (= 5.1.5) was resolved to 5.1.5, which depends on
activemodel (= 5.1.5)
web-console (~> 2.0) was resolved to 2.0.0, which depends on
activemodel (~> 4.0)
I have tried updating ruby and the rails version
Related
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.)
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 running bundle install command. Ruby version is 2.2.0 and Rails version is 4.1.8. Environment is Apple Mac OS Sierra (10.12.5)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
composite_primary_keys (= 7.0.15) was resolved to 7.0.15, which depends on
activerecord (~> 4.1.7)
rails (= 4.2.4) was resolved to 4.2.4, which depends on
activerecord (= 4.2.4)
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rack (~> 1.5.3)
omniauth was resolved to 1.7.1, which depends on
rack (< 3, >= 1.6.2)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 4.2.4)
commands was resolved to 0.2.1, which depends on
rails (>= 3.2.0)
model_tree was resolved to 1.0, which depends on
rails
You need to upgrade the version of composite_primary_keys gem.
Change it to ~> 8.0.0 which requires activerecord '~>4.2.0'
gem 'composite_primary_keys', '~> 8.0.0'
Refer composite_primary_keys.gemspec
Similarly, for other gems you can do the same.
Or if you are not sure on the gem versions you can just add gem name and leave the versions for bundler to take care of it.
I changed the rails line in my app's Gemfile from:
gem 'rails', '4.2.3'
To:
gem 'rails', '5.0.0'
Per the rails documentation on the upgrade process. I then ran bundle update rails. I then hit a roadblock:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
dotenv-rails (= 2.0.2) was resolved to 2.0.2, which depends on
railties (~> 4.0)
rails (= 5.0.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0)
As I understand, railties is part of rails? So that seemed weird. To humor the error, I added:
gem 'railties', '5.0.0'
Then bundle update railties yields:
Bundler could not find compatible versions for gem "activerecord":
In snapshot (Gemfile.lock):
activerecord (= 4.2.3)
In Gemfile:
annotate was resolved to 2.7.2, which depends on
activerecord (< 6.0, >= 3.2)
rails (= 5.0.0) was resolved to 5.0.0, which depends on
activerecord (= 5.0.0)
I follow the rabbithole and add:
gem 'activerecord', '5.0.0'
bundle update activerecord yields...
You have requested:
railties = 5.0.0
The bundle currently has railties locked at 4.2.3.
Try running `bundle update railties`
The whole reason I am even updating active record is so that I can update railties... it's running me in circles.
If I run bundle update with my full Gemfile now (activerecord and railties added):
Bundler could not find compatible versions for gem "railties":
In Gemfile:
devise (~> 3.5.6) was resolved to 3.5.6, which depends on
railties (< 5, >= 3.2.6)
rails (= 5.0.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0)
rails (= 5.0.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0)
I'll admit I'm not a total pro at this process. Is there anything I am missing? Has anyone experienced something like this during their upgrade process?
First error means bundle update dotenv-rails, if you are restricting the version make sure it's to one that supports railties 5. Based on your updates, it seems you are in a older devise too. So try to update both at the same time:
bundle update dotenv-rails devise, make sure you read the update notes in dotenv-rails and devise and change anything that needs to be change in your code.
My advise: go to the closest version that supports rails 5 first, so for devise that's 4.0.3 and dotenv-rails 2.1.2. Set this restrictions in your Gemfile before you bundle update. Only after you update this gems successfully attempt to update rails. Add any other gem that comes up to this same process.
I just cant upgrade rails beta version.
My current rails version is 5.0.2 and would like to upgrade to 5.1.0.beta1 version.
ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
bundle update rails
Fetching gem metadata from http://rubygems.org/........
Fetching version metadata from http://rubygems.org/..`
Fetching dependency metadata from http://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails (~> 4.1.0) was resolved to 4.1.1, which depends on
railties (< 5.1.x, >= 4.0.0)
rails (~> 5.1.0.beta1) was resolved to 5.1.0.beta1, which depends on
railties (= 5.1.0.beta1)
sass-rails (~> 5.0) was resolved to 5.0.6, which depends on
railties (< 6, >= 4.0.0)
bundle update
Fetching https://github.com/megetron/active_merchant_tranzila.git
Fetching https://github.com/megetron/active_shipping.git
Fetching gem metadata from http://rubygems.org/........
Fetching version metadata from http://rubygems.org/..
Fetching dependency metadata from http://rubygems.org/.
Resolving dependencies...
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)
devise was resolved to 4.2.0, which depends on
railties (< 5.1, >= 4.1.0)
rails (~> 5.1.0.beta1) was resolved to 5.1.0.beta1, which depends on
railties (= 5.1.0.beta1)
sass-rails (~> 5.0) was resolved to 5.0.6, which depends on
railties (< 6, >= 4.0.0)
web-console (~> 2.0) was resolved to 2.3.0, which depends on
railties (>= 4.0)
If I'm reading this correctly, you need to remove the version constraint of coffee-rails in your Gemfile because it is incompatible with Rails 5.1.x.
Do this in your terminal
gem update rails
bundle update
Try to use the devise gem from the repository as they have not released a rails 5.1 version yet (it will probably happen very soon).
In your Gemfile replace the devise line with the following:
gem 'devise', github: 'plataformatec/devise'