Bundler Dependency Failed to Resolve - ruby

Updating Rails from 5 to 6, I get this dependency error:
Bundler could not find compatible versions for gem "rubyzip":
In Gemfile:
rubyzip (~> 1.2.2)
roo (~> 2.6) was resolved to 2.8.2, which depends on
rubyzip (< 2.0.0, >= 1.2.1)
selenium-webdriver (~> 3.142) was resolved to 3.142.7, which depends on
rubyzip (>= 1.2.2)
I must be reading this wrong because from what I can see, the 2 conflicting gems should both be ok with v 1.2.2 of rubyzip.
What is the very fundamental that I'm missing? There are some other dependencies out of whack in the rest of the output, but this is the only one concerning rubyzip

Related

Bundler update dependencies clash

Each time I update gems with bundler I got something I really do not fully understand. Although it resolves in some way in the end :)
So in this example I really can't get why the 1.11.1 is not fit in the constrains:
1.11.1 is >= 1.3.3
and >= 1.5.11, < 2.0.0
and ~> 1
and ~> 1.3
right?
Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
nokogiri (= 1.11.1)
cuprite (~> 0.8) was resolved to 0.8, which depends on
capybara (>= 2.1, < 4) was resolved to 2.18.0, which depends on
nokogiri (>= 1.3.3)
s3_uploader was resolved to 0.2.3, which depends on
fog-aws (>= 0.9.4) was resolved to 3.5.2, which depends on
fog-xml (~> 0.1) was resolved to 0.1.3, which depends on
nokogiri (>= 1.5.11, < 2.0.0)
mimemagic (= 0.3.10) was resolved to 0.3.10, which depends on
nokogiri (~> 1)
cuprite (~> 0.8) was resolved to 0.8, which depends on
capybara (>= 2.1, < 4) was resolved to 2.18.0, which depends on
xpath (>= 2.0, < 4.0) was resolved to 2.1.0, which depends on
nokogiri (~> 1.3)
Thanks guys!

Way out of date GEM file and new to ruby..where to begin?

this was a project from 2015 ... so nothing has been update or made new....just dumped on my plate.
gem query --local
*** LOCAL GEMS ***
actionmailer (4.1.2)
actionpack (4.1.2)
actionview (4.1.2)
activemodel (4.1.2)
activerecord (4.1.2)
activesupport (4.1.3, 4.1.2)
arel (5.0.1.20140414130214)
bigdecimal (1.2.8)
builder (3.2.4)
bundler (1.17.3)
concurrent-ruby (1.1.10)
did_you_mean (1.0.0)
erubis (2.7.0)
i18n (0.9.5)
io-console (0.4.5)
json (1.8.3)
after running bundle install
So I'm wondering where I should begin to start getting this worked out.
Coming from a PHP/Python background....not liking this ruby ;)
bundler could not find compatible versions for gem "actionpack":
In Gemfile:
actionpack-action_caching was resolved to 1.2.2, which depends on
actionpack (>= 4.0.0)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
kaminari (~> 0.14) was resolved to 0.17.0, which depends on
actionpack (>= 3.0.0)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
actionpack (= 4.1.2)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
sprockets-rails (~> 2.0) was resolved to 2.3.3, which depends on
actionpack (>= 3.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
paperclip (~> 4.3) was resolved to 4.3.7, which depends on
activemodel (>= 3.2.0)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
activemodel (= 4.1.2)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
jbuilder (~> 2.0) was resolved to 2.6.4, which depends on
activesupport (>= 3.0.0)
paperclip (~> 4.3) was resolved to 4.3.7, which depends on
activesupport (>= 3.2.0)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
activesupport (= 4.1.2)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
sprockets-rails (~> 2.0) was resolved to 2.3.3, which depends on
activesupport (>= 3.0)
Bundler could not find compatible versions for gem "font-awesome-rails":
In Gemfile:
font-awesome-rails (= 4.1.0.0)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
font-awesome-rails (< 5, >= 3.0)
Bundler could not find compatible versions for gem "i18n":
In Gemfile:
rails (= 4.1.2) was resolved to 4.1.2, which depends on
activesupport (= 4.1.2) was resolved to 4.1.2, which depends on
i18n (>= 0.6.9, ~> 0.6)
capistrano was resolved to 3.17.1, which depends on
i18n
Bundler could not find compatible versions for gem "jbuilder":
In Gemfile:
jbuilder (~> 2.0)
jpbuilder was resolved to 0.3.0, which depends on
jbuilder
Bundler could not find compatible versions for gem "jquery-rails":
In Gemfile:
jquery-rails
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
jquery-rails (< 5, >= 3.0)
Bundler could not find compatible versions for gem "mimemagic":
In Gemfile:
paperclip (~> 4.3) was resolved to 4.3.7, which depends on
mimemagic (= 0.3.0)
Could not find gem 'mimemagic (= 0.3.0)', which is required by gem 'paperclip (~> 4.3)', in any of the sources.
Bundler could not find compatible versions for gem "net-ssh":
In Gemfile:
capistrano was resolved to 3.17.1, which depends on
sshkit (>= 1.9.0) was resolved to 1.21.3, which depends on
net-scp (>= 1.1.2) was resolved to 4.0.0, which depends on
net-ssh (< 8.0.0, >= 2.6.5)
capistrano was resolved to 3.17.1, which depends on
sshkit (>= 1.9.0) was resolved to 1.21.3, which depends on
net-ssh (>= 2.8.0)
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (= 4.1.2) was resolved to 4.1.2, which depends on
actionpack (= 4.1.2) was resolved to 4.1.2, which depends on
rack (~> 1.5.2)
passenger (>= 5.0.25) was resolved to 6.0.15, which depends on
rack
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
rack-pjax (~> 0.7) was resolved to 0.8.0, which depends on
rack (~> 1.1)
sass-rails (~> 4.0.3) was resolved to 4.0.5, which depends on
sprockets (< 3.0, ~> 2.8) was resolved to 2.12.5, which depends on
rack (~> 1.0)
devise was resolved to 4.8.1, which depends on
warden (~> 1.2.3) was resolved to 1.2.7, which depends on
rack (>= 1.0)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (= 4.1.2)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
rails (~> 4.0)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
coffee-rails (~> 4.0) was resolved to 4.2.2, which depends on
railties (>= 4.0.0)
devise was resolved to 4.8.1, which depends on
railties (>= 4.1.0)
font-awesome-rails (= 4.1.0.0) was resolved to 4.1.0.0, which depends on
railties (< 5.0, >= 3.2)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
jquery-rails (< 5, >= 3.0) was resolved to 3.1.5, which depends on
railties (< 5.0, >= 3.0)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
jquery-ui-rails (~> 5.0) was resolved to 5.0.5, which depends on
railties (>= 3.2.16)
js-routes was resolved to 1.4.14, which depends on
railties (>= 4)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
railties (= 4.1.2)
sass-rails (~> 4.0.3) was resolved to 4.0.5, which depends on
railties (< 5.0, >= 4.0.0)
Bundler could not find compatible versions for gem "ruby":
In Gemfile:
ruby
aws-sdk was resolved to 3.1.0, which depends on
ruby (>= 2.3)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
bundler (< 2.0, >= 1.3.0) was resolved to 1.17.3, which depends on
ruby (>= 1.8.7)
byebug was resolved to 11.0.1, which depends on
ruby (>= 2.3.0)
capistrano was resolved to 3.17.1, which depends on
ruby (>= 2.0)
guard-livereload was resolved to 2.5.2, which depends on
guard (~> 2.8) was resolved to 2.18.0, which depends on
pry (>= 0.13.0) was resolved to 0.14.1, which depends on
coderay (~> 1.1) was resolved to 1.1.3, which depends on
ruby (>= 1.8.6)
devise was resolved to 4.8.1, which depends on
ruby (>= 2.1.0)
guard-livereload was resolved to 2.5.2, which depends on
guard (~> 2.8) was resolved to 2.18.0, which depends on
listen (< 4.0, >= 2.7) was resolved to 3.5.0, which depends on
ruby (>= 2.2.7)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
activesupport (= 4.1.2) was resolved to 4.1.2, which depends on
minitest (~> 5.1) was resolved to 5.15.0, which depends on
ruby (< 4.0, >= 2.2)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
rack-pjax (~> 0.7) was resolved to 0.8.0, which depends on
nokogiri (~> 1.5) was resolved to 1.12.5, which depends on
ruby (>= 2.5.0)
paperclip (~> 4.3) was resolved to 4.3.7, which depends on
ruby (>= 1.9.2)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
ruby (>= 1.9.3)
capistrano was resolved to 3.17.1, which depends on
rake (>= 10.0.0) was resolved to 13.0.6, which depends on
ruby (>= 2.2)
Bundler could not find compatible versions for gem "sass-rails":
In Gemfile:
sass-rails (~> 4.0.3)
rails_admin (~> 0.6.2) was resolved to 0.6.8, which depends on
sass-rails (< 6, >= 4.0)
Bundler could not find compatible versions for gem "sprockets":
In Gemfile:
sass-rails (~> 4.0.3) was resolved to 4.0.5, which depends on
sprockets (< 3.0, ~> 2.8)
rails (= 4.1.2) was resolved to 4.1.2, which depends on
sprockets-rails (~> 2.0) was resolved to 2.3.3, which depends on
sprockets (< 4.0, >= 2.8)
And the GEMFILE
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.2'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.3.18'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
# gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
gem 'jpbuilder'
# bundle exec rake doc:rails generates the API under doc/api.
# gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler"
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
group :development do
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-faster-assets', '~> 1.0'
gem 'capistrano-rbenv'
gem 'capistrano-passenger'
gem 'byebug'
end
# Use debugger
# gem 'debugger', group: [:development, :test]
# https://github.com/plataformatec/devise
gem 'devise'
# https://github.com/sferik/rails_admin
gem 'rails_admin', '~> 0.6.2'
# https://github.com/thoughtbot/paperclip
gem 'paperclip', '~> 4.3'
# https://github.com/42dev/bower-rails
gem 'bower-rails', '~> 0.9.0'
# https://github.com/guard/guard-livereload
gem 'guard-livereload', group: :development
# https://github.com/johnbintz/rack-livereload
gem 'rack-livereload', group: :development
# http://railsware.github.io/js-routes/
gem 'js-routes'
# https://github.com/aws/aws-sdk-ruby
gem 'aws-sdk'
# Action caching. Read more: https://github.com/rails/actionpack-action_caching
gem 'actionpack-action_caching'
# Dalli memcached client. Read more: https://github.com/mperham/dalli
gem 'dalli'
# https://github.com/bokmann/font-awesome-rails
gem 'font-awesome-rails', '4.1.0.0'
# WYSIWYG editor for admin backend. Read more: https://github.com/galetahub/ckeditor
gem 'ckeditor'```
This Rails version remembers the last mammoths so what did you expect? :)
First things first:
Double check you are not trying to build this project on the bleeding edge Ruby (3.x). Even the latest 2.x might be a problem with Rails that old. Google "Rails & Ruby compatibility" to check which Ruby version is recommended for this fossil and don't try to move too far ahead. Use some Ruby version manager to switch between versions easily (my choice is asdf, but more common rbenv or rvm work too).
If downgrading Ruby doesn't help, try removing Gemfile.lock (copy it somewhere just in case) and reinstalling dependencies. Bundler locks dependencies there to minimize the surface of dependencies' changes. This is a very good thing during the normal development cycle, but for "archeological excavations" like the one you have to work with this might be a problem. With the lock file removed bundler will re-evaluate the dependencies graph from scratch so most of the conflicts you see now should be resolved. Probably :)
Be ready that even after this, you might have conflicts that the bundler cannot resolve on its own (due to some older versions of dependencies that are unavailable anymore etc).

Ruby Gem ActiveAdmin Install Error

i am trying to install ActiveAdmin Gem i get the following error. i am running it from the commandline
harsha#harshamv:~$ gem install activeadmin
ERROR: While executing gem ... (Gem::DependencyResolutionError)
conflicting dependencies arel (~> 2.0.2) and arel (~> 4.0.0)
Activated arel-4.0.0 via:
arel-4.0.0 (~> 4.0.0), activerecord-4.0.0.rc2 (= 4.0.0.rc2), rails-4.0.0.rc2 (< 4, >= 3.0.0), activeadmin-0.6.3 (= 0.6.3)
instead of (~> 2.0.2) via:
meta_search-1.0.0 (~> 1.0), activeadmin-0.6.3 (= 0.6.3)
If you are using Rails 4, you need to use >= 1.0.0.pre version of ActiveAdmin. The best way of doing that right now is:
gem 'activeadmin', github: 'gregbell/active_admin'
in your Gemfile.

Gem dependency - how to limit output?

I'd like to display required dependencies of a specific gem before installing.
gem dependency -r nokogiri
Gem nokogiri-1.6.0
...
Gem nokogiri-diff-0.2.0
...
Gem nokogiri-fitzsimmons-1.5.5.3
...
Gem nokogiri-happymapper-0.5.7
...
# etc. - many other gems & dependencies follow
How to limit output of gem dep to display only current nokogiri gem dependencies and nothing more ?
By the help to dependency command it accepts GEMNAME argument. Why it matches also other gems just starting with the same string ?
I've tried if regular expressions do work but f.E. gem dep -r '^nokogiri$' returns nothing.
Regular expressions are generally enclosed in forward slashes.
$ gem dep -r /^nokogiri$/
Gem nokogiri-1.6.0
hoe (~> 2.16, development)
hoe-bundler (>= 1.1, development)
hoe-debugging (>= 1.0.3, development)
hoe-gemspec (>= 1.0, development)
hoe-git (>= 1.4, development)
mini_portile (~> 0.5.0)
minitest (~> 2.2.2, development)
racc (>= 1.4.6, development)
rake (>= 0.9, development)
rake-compiler (~> 0.8.0, development)
rdoc (~> 3.10, development)
rexical (>= 1.0.5, development)

Why does Bundler think it needs a specific version to satisfy the dependency of a gem?

This is not the first time I've run into this, but here's a concrete example:
$ bundle update rails
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "builder":
In Gemfile:
rails (~> 3.0.0) ruby depends on
builder (~> 2.1.2) ruby
hoptoad_notifier (>= 0) ruby depends on
builder (3.0.0)
So Bundler claims the hoptoad_notifier gem depends on the 3.0.0 version of builder. But that's not the case, it only requires builder >= 0.
$ gem dependency hoptoad_notifier
Gem hoptoad_notifier-2.4.11
actionpack (>= 0, development)
activerecord (>= 0, development)
activesupport (>= 0, runtime)
bourne (>= 0, development)
builder (>= 0, runtime)
nokogiri (>= 0, development)
shoulda (>= 0, development)
Why does Bundler think hoptoad_notifier depends on builder 3.0.0?
Selected bits from the Gemfile and Gemfile.lock:
source "http://rubygems.org"
gem 'rails', '~> 3.0.0'
gem 'hoptoad_notifier'
...a bunch of testing gems, custom gems, etc.
Gemfile.lock
GEM
remote: http://rubygems.org/
specs:
actionmailer (2.3.14)
actionpack (= 2.3.14)
...
builder (3.0.0)
...
cucumber (1.2.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.10.0)
json (>= 1.4.6)
...
hoptoad_notifier (2.4.11)
activesupport
builder
... no other mentions of builder
I consider this more of a workaround than an answer to the question, so I'll leave the question open for a while to see if there's a better answer.
I found different ways to attack the problem (using bundle update on specific gems, modifying the Gemfile, running bundle install), but continued to run into some form of this error for various dependencies. It really seems like an issue with Bundler. (I'm using v1.0.22, upgrading made it worse.) Ultimately, what got me out of this mess was to delete the Gemfile.lock and run bundle install, letting Bundler resolve all the dependencies from scratch. Now of course, this is far from ideal, since the whole reason you have a lock file is to lock down your app's dependencies. But since I'm upgrading Rails to v3 anyway, it was acceptable in this case.

Resources