Gem version conflict - ruby-on-rails

I am getting the following error when I run 'bundle install':
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
google-drive (>= 0) ruby depends on
middleman-core (>= 3.2.2) ruby depends on
activesupport (~> 3.2.6) ruby
rails (= 4.2.0) ruby depends on
activesupport (4.2.0)
I don't specify a version for the google-drive gemfile, but I do specify gem 'rails', '4.2.0'.
If I fail to specify a rails version, I get a really old version.

Try to update google-drive. Run bundle update google-drive.

Well - it looks like I was using the wrong gem. It's google_drive not google-drive.

Related

When upgrading from rails 5.1 to 5.2, how do you update your Gemfile?

I'm trying to upgrade my rails application from 5.1.4 to 5.2.
I've gone through the steps here:
https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-5-1-to-5-2.html
However, this completely skips over how to update your gemfile.
When I change
gem 'rails', '~> 5.1.4'
to
gem 'rails', '~> 5.2.2'
I receive the error:
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 5.1.6.1)
In Gemfile:
rails (~> 5.2.2) was resolved to 5.2.2, which depends on
activesupport (= 5.2.2)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
railties (>= 4.0.0, < 6) was resolved to 5.1.6.1, which depends on
activesupport (= 5.1.6.1)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
I can resolve these errors, but this seems to be an incomplete way to update.
What is the proper way to update your gemfile?
bundle update rails
after this you can use gem "bundleup" to see what other gems you can update.

Bundle install command error. Ruby version is 2.2.0 and Rails version is 4.1.8

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.

Upgrading my app to Rails 5. Not sure what to make of errors on bundle install

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.

neo4j will_paginate gem installation issue

Running bundle install after including the gem gives me this
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
neo4j-will_paginate (>= 0) ruby depends on
activesupport (~> 3.0) ruby
rails (= 4.1.6) ruby depends on
activesupport (4.1.6)
I am on gem 'rails', '4.1.6' and the app was originally created without AR and added back in later.
I have seen some other example SO but don't want to do any gemlock changes without certainy
Suggestions on troubleshooting?
Use neo4j-will_paginate_redux, not that gem. We rereleased under this name because we could not get access to the original on Rubygems.

Railties gem compatibly issue - sorry I am new to Rails and Ruby

when pushing to Heroku I get the following bundler error
Fetching gem metadata from https://rubygems.org/.........
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 3.2.1) ruby depends on
railties (= 3.2.1) ruby
jquery-rails (= 2.0.0) ruby depends on
railties (3.2.6)
I was having the same problem, so I looked up the jquery-rails gem and saw that it has been updated to version 2.0.2. I updated my Gemfile to that version and ran bundle install again and everything worked. Commit your Gemfile of course, so that the update gets pushed to Heroku as well.

Resources