Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Dependency graph resolution error with micro versions #5031

Closed
maletor opened this issue Sep 29, 2016 · 6 comments
Closed

Dependency graph resolution error with micro versions #5031

maletor opened this issue Sep 29, 2016 · 6 comments
Assignees

Comments

@maletor
Copy link

maletor commented Sep 29, 2016

I was running bundle update paperclip with gem 'rails', '~> 4.2.7.1' in my Gemfile. However, bundler has a bad code path for recognizing 4.2.7.1 as greater than or equal to 4.2.0.

By changing the rails dependency to gem 'rails', '~> 4.2.7', I was able to work around the issue.

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
      activemodel (>= 4.2.0) was resolved to 5.0.0.1, which depends on
        activesupport (= 5.0.0.1)

    friendly_id (~> 5.1.0) was resolved to 5.1.0, which depends on
      activerecord (>= 4.0.0) was resolved to 4.2.7.1, which depends on
        activesupport (= 4.2.7.1)

    authlogic (~> 3.4.6) was resolved to 3.4.6, which depends on
      activesupport (>= 3.2)

    paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
      cocaine (~> 0.5.5) was resolved to 0.5.8, which depends on
        climate_control (< 1.0, >= 0.0.3) was resolved to 0.0.3, which depends on
          activesupport (>= 3.0)

    paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
      activesupport (>= 4.2.0)
@maletor maletor changed the title Bundler resolution dependency graph resolution error with micro versions Bundler dependency graph resolution error with micro versions Sep 29, 2016
@chrismo
Copy link
Contributor

chrismo commented Sep 29, 2016

can you paste in your bundle env?

@maletor maletor changed the title Bundler dependency graph resolution error with micro versions Dependency graph resolution error with micro versions Sep 29, 2016
@maletor
Copy link
Author

maletor commented Sep 30, 2016

What about building one with just rails and paperclip? That should be enough to highlight the issue. If it's unique to my bundler env we can cross that bridge when we get there, but I'd rather not make it public.

@segiddins
Copy link
Member

In that case, please reduce this to a Gemfile you can share. Thanks!

@chrismo
Copy link
Contributor

chrismo commented Sep 30, 2016

If you can also include the other bits of bundle env - which will show which version of bundler and other environment settings, that will be helpful.

@maletor
Copy link
Author

maletor commented Sep 30, 2016

Environment

    Bundler   1.13.1
    Rubygems  2.5.1
    Ruby      2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]
    Git       2.10.0

Bundler settings

    jobs
      Set for the current user (/Users/maletor/.bundle/config): "7"
    path
      Set for your local app (/Users/maletor/src/bundler-5031/.bundle/config): ".bundle/gems"
    disable_shared_gems
      Set for your local app (/Users/maletor/src/bundler-5031/.bundle/config): "true"

Gemfile

    source 'https://rubygems.org'
    gem 'rails', '~> 4.2.7.1'
    gem 'paperclip', '~> 5.1.0'

Gemfile.lock

    GEM
      remote: https://rubygems.org/
      specs:
        actionmailer (4.2.7.1)
          actionpack (= 4.2.7.1)
          actionview (= 4.2.7.1)
          activejob (= 4.2.7.1)
          mail (~> 2.5, >= 2.5.4)
          rails-dom-testing (~> 1.0, >= 1.0.5)
        actionpack (4.2.7.1)
          actionview (= 4.2.7.1)
          activesupport (= 4.2.7.1)
          rack (~> 1.6)
          rack-test (~> 0.6.2)
          rails-dom-testing (~> 1.0, >= 1.0.5)
          rails-html-sanitizer (~> 1.0, >= 1.0.2)
        actionview (4.2.7.1)
          activesupport (= 4.2.7.1)
          builder (~> 3.1)
          erubis (~> 2.7.0)
          rails-dom-testing (~> 1.0, >= 1.0.5)
          rails-html-sanitizer (~> 1.0, >= 1.0.2)
        activejob (4.2.7.1)
          activesupport (= 4.2.7.1)
          globalid (>= 0.3.0)
        activemodel (4.2.7.1)
          activesupport (= 4.2.7.1)
          builder (~> 3.1)
        activerecord (4.2.7.1)
          activemodel (= 4.2.7.1)
          activesupport (= 4.2.7.1)
          arel (~> 6.0)
        activesupport (4.2.7.1)
          i18n (~> 0.7)
          json (~> 1.7, >= 1.7.7)
          minitest (~> 5.1)
          thread_safe (~> 0.3, >= 0.3.4)
          tzinfo (~> 1.1)
        arel (6.0.3)
        builder (3.2.2)
        climate_control (0.0.3)
          activesupport (>= 3.0)
        cocaine (0.5.8)
          climate_control (>= 0.0.3, < 1.0)
        concurrent-ruby (1.0.2)
        erubis (2.7.0)
        globalid (0.3.7)
          activesupport (>= 4.1.0)
        i18n (0.7.0)
        json (1.8.3)
        loofah (2.0.3)
          nokogiri (>= 1.5.9)
        mail (2.6.4)
          mime-types (>= 1.16, < 4)
        mime-types (3.1)
          mime-types-data (~> 3.2015)
        mime-types-data (3.2016.0521)
        mimemagic (0.3.2)
        mini_portile2 (2.1.0)
        minitest (5.9.1)
        nokogiri (1.6.8)
          mini_portile2 (~> 2.1.0)
          pkg-config (~> 1.1.7)
        paperclip (5.1.0)
          activemodel (>= 4.2.0)
          activesupport (>= 4.2.0)
          cocaine (~> 0.5.5)
          mime-types
          mimemagic (~> 0.3.0)
        pkg-config (1.1.7)
        rack (1.6.4)
        rack-test (0.6.3)
          rack (>= 1.0)
        rails (4.2.7.1)
          actionmailer (= 4.2.7.1)
          actionpack (= 4.2.7.1)
          actionview (= 4.2.7.1)
          activejob (= 4.2.7.1)
          activemodel (= 4.2.7.1)
          activerecord (= 4.2.7.1)
          activesupport (= 4.2.7.1)
          bundler (>= 1.3.0, < 2.0)
          railties (= 4.2.7.1)
          sprockets-rails
        rails-deprecated_sanitizer (1.0.3)
          activesupport (>= 4.2.0.alpha)
        rails-dom-testing (1.0.7)
          activesupport (>= 4.2.0.beta, < 5.0)
          nokogiri (~> 1.6.0)
          rails-deprecated_sanitizer (>= 1.0.1)
        rails-html-sanitizer (1.0.3)
          loofah (~> 2.0)
        railties (4.2.7.1)
          actionpack (= 4.2.7.1)
          activesupport (= 4.2.7.1)
          rake (>= 0.8.7)
          thor (>= 0.18.1, < 2.0)
        rake (11.3.0)
        sprockets (3.7.0)
          concurrent-ruby (~> 1.0)
          rack (> 1, < 3)
        sprockets-rails (3.2.0)
          actionpack (>= 4.0)
          activesupport (>= 4.0)
          sprockets (>= 3.0.0)
        thor (0.19.1)
        thread_safe (0.3.5)
        tzinfo (1.2.2)
          thread_safe (~> 0.1)

    PLATFORMS
      ruby

    DEPENDENCIES
      paperclip (~> 5.1.0)
      rails (~> 4.2.7.1)

    BUNDLED WITH
       1.13.1
~/s/bundler-5031 ❯❯❯ bundle update paperclip
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
      activemodel (>= 4.2.0) was resolved to 5.0.0.1, which depends on
        activesupport (= 5.0.0.1)

    paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
      cocaine (~> 0.5.5) was resolved to 0.5.8, which depends on
        climate_control (< 1.0, >= 0.0.3) was resolved to 0.0.3, which depends on
          activesupport (>= 3.0)

    paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
      activesupport (>= 4.2.0)

    rails (~> 4.2.7.1) was resolved to 4.2.7.1, which depends on
      activesupport (= 4.2.7.1)

@segiddins
Copy link
Member

I just confirmed that #5101 will fix this

@segiddins segiddins self-assigned this Jan 15, 2017
bundlerbot added a commit that referenced this issue Jan 15, 2017
…, r=indirect

[Resolver] Consider locked dependencies first

Closes #5031
Closes #5095

\c @marcandre @indirect
philipefarias added a commit to dleemoo/rc-images that referenced this issue Jun 12, 2017
Changes since last version used (1.14.6):

== 1.15.1 (2017-06-02)

Bugfixes:

  - `bundle lock --update GEM` will fail gracefully when the gem is not in the lockfile (rubygems/bundler#5693, @segiddins)
  - `bundle init --gemspec` will fail gracefully when the gemspec is invalid (@colby-swandale)
  - `bundle install --force` works when the gemfile contains git gems (rubygems/bundler#5678, @segiddins)
  - `bundle env` will print well-formed markdown when there are no settings (rubygems/bundler#5677, @segiddins)

== 1.15.0 (2017-05-19)

This space intentionally left blank.

== 1.15.0.pre.4 (2017-05-10)

Bugfixes:

  - avoid conflicts when `Gem.finish_resolve` is called after the bundle has been set up (@segiddins)
  - ensure that `Gem::Specification.find_by_name` always returns an object that can have `#to_spec` called on it (rubygems/bundler#5592, @jules2689)

== 1.15.0.pre.3 (2017-04-30)

Bugfixes:

  - avoid redundant blank lines in the readme generated by `bundle gem` (@koic)
  - ensure that `open-uri` is not loaded after `bundle exec` (@segiddins)
  - print a helpful error message when an activated default gem conflicts with
    a gem in the gemfile (@segiddins)
  - only shorten `ref` option for git gems when it is a SHA (rubygems/bundler#5620, @segiddins)

== 1.15.0.pre.2 (2017-04-23)

Bugfixes:

  - ensure pre-existing fit caches are updated from remote sources (rubygems/bundler#5423, @alextaylor000)
  - avoid duplicating specs in the lockfile after updating with the gem uninstalled (rubygems/bundler#5599, @segiddins)
  - ensure git gems have their extensions available at runtime (rubygems/bundler#5594, @jules2689, @segiddins)

== 1.15.0.pre.1 (2017-04-16)

Features:

  - print a notification when a newer version of bundler is available (rubygems/bundler#4683, @segiddins)
  - add man pages for all bundler commands (rubygems/bundler#4988, @feministy)
  - add the `bundle info` command (@fredrb, @colby-swandale)
  - all files created with `bundle gem` comply with the bundler style guide (@zachahn)
  - if installing a gem fails, print out the reason the gem needed to be installed (rubygems/bundler#5078, @segiddins)
  - allow setting `gem.push_key` to set the key used when running `rake release` (@DTrierweiler)
  - print gem versions that are regressing during `bundle update` in yellow (rubygems/bundler#5506, @brchristian)
  - avoid printing extraneous dependencies when the resolver encounters a conflict (@segiddins)
  - add the `bundle issue` command that prints instructions for reporting issues (rubygems/bundler#4871, @jonathanpike)
  - add `--source` and `--group` options to the `bundle inject` command (rubygems/bundler#5452, @Shekharrajak)
  - add the `bundle add` command to add a gem to the gemfile (@denniss)
  - add the `bundle pristine` command to re-install gems from cached `.gem` files (rubygems/bundler#4509, @denniss)
  - add a `--parseable` option for `bundle config` (@JuanitoFatas, @colby-swandale)

Performance:

  - speed up gemfile initialization by storing locked dependencies as a hash (@jules2689)
  - speed up gemfile initialization by making locked dependency comparison lazy, avoiding object allocation (@jules2689)
  - only validate git gems when they are downloaded, instead of every time `Bundler.setup` is run (@segiddins)
  - avoid regenerating the lockfile when nothing has changed (@segiddins)
  - avoid diffing large arrays when no sources in the gemfile have changed (@segiddins)
  - avoid evaluating full gemspecs when running with RubyGems 2.5+ (@segiddins)

Bugfixes:

  - fix cases where `bundle update` would print a resolver conflict instead of updating the selected gems (rubygems/bundler#5031, rubygems/bundler#5095, @segiddins)
  - print out a stack trace after an interrupt when running in debug mode (@segiddins)
  - print out when bundler starts fetching a gem from a remote server (@segiddins)
  - fix `bundle gem` failing when `git` is unavailable (rubygems/bundler#5458, @Shekharrajak, @colby-swandale)
  - suggest the appropriate command to unfreeze a bundle (rubygems/bundler#5009, @denniss)
  - ensure nested calls to `bundle exec` resolve default gems correctly (rubygems/bundler#5500, @segiddins)
  - ensure that a plugin failing to install doesn't uninstall other plugins (@kerrizor, @roseaboveit)
  - ensure `socket` is required before being referenced (rubygems/bundler#5533, @rafaelfranca)
  - allow running `bundle outdated` when gems aren't installed locally (rubygems/bundler#5553, @segiddins)
  - print a helpful error when `bundle exec`ing to a gem that isn't included in the bundle (rubygems/bundler#5487, @segiddins)
  - print an error message when a non-git gem is given a `branch` option (rubygems/bundler#5530, @colby-swandale)
  - allow interrupts to exit the process after gems have been installed (@segiddins)
  - print the underlying error when downloading gem metadata fails (rubygems/bundler#5579, @segiddins)
  - avoid deadlocking when installing with a lockfile that is missing dependencies (rubygems/bundler#5378, rubygems/bundler#5480, rubygems/bundler#5519, rubygems/bundler#5526, rubygems/bundler#5529, rubygems/bundler#5549, rubygems/bundler#5572, @segiddins)
pombredanne pushed a commit to nexB/univers that referenced this issue Dec 7, 2021
…, r=indirect

[Resolver] Consider locked dependencies first

Closes rubygems/bundler#5031
Closes #5095

\c @marcandre @indirect
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants