Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem::DependencyResolutionError when installing Rails 5.1.0.beta1 #1851

Closed
Najtmare opened this issue Feb 24, 2017 · 6 comments

Comments

@Najtmare
Copy link

commented Feb 24, 2017

Hi,

There seems to be an issue when trying to install a pre release of Rails. This same issue also popped up for the first time (at least for me) when rails 5 beta was released, more info at #1653.

I get no output when I run gem install rails --pre. When I do run gem install rails -v 5.1.0.beta1 --verbose, I get this:

➜  gem install rails -v 5.1.0.beta1 --verbose
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=rails
200 OK
Getting SRV record failed: DNS result has no information for _rubygems._tcp.api.rubygems.org
GET https://api.rubygems.org/api/v1/dependencies?gems=actioncable,actionmailer,actionpack,actionview,activejob,activemodel,activerecord,activesupport,bundler,railties,sprockets-rails
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=sprockets
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=concurrent-ruby,rack
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=i18n,minitest,nio4r,tzinfo,websocket-driver
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=websocket-extensions
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=builder,erubis,mail,rack-test,rails-dom-testing,rails-html-sanitizer
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=method_source,nokogiri,rake,thor,thread_safe
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=hike,journey,multi_json,rack-cache,rack-mount,tilt
200 OK
ERROR:  While executing gem ... (Gem::DependencyResolutionError)
    conflicting dependencies activesupport (= 3.0.0) and activesupport (= 5.1.0.beta1)
  Activated activesupport-5.1.0.beta1
  which does not match conflicting dependency (= 3.0.0)

  Conflicting dependency chains:
    rails (= 5.1.0.beta1), 5.1.0.beta1 activated, depends on
    activesupport (= 5.1.0.beta1), 5.1.0.beta1 activated

  versus:
    rails (= 5.1.0.beta1), 5.1.0.beta1 activated, depends on
    sprockets-rails (>= 2.0.0), 2.0.0 activated, depends on
    actionpack (>= 3.0), 3.0.0 activated, depends on
    activesupport (= 3.0.0)

I was, however able to install rails 5.1.0.beta1 using this snippet:

ruby -rbundler/inline -e "gemfile(true) do; source 'https://rubygems.org/'; gem 'rails', '5.1.0.beta1'; end"

Gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.10
  - RUBY VERSION: 2.4.0 (2016-12-24 patchlevel 0) [x86_64-darwin15]
  - INSTALLATION DIRECTORY: /Users/millan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0
  - USER INSTALLATION DIRECTORY: /Users/millan/.gem/ruby/2.4.0
  - RUBY EXECUTABLE: /Users/millan/.rbenv/versions/2.4.0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/millan/.rbenv/versions/2.4.0/bin
  - SPEC CACHE DIRECTORY: /Users/millan/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/millan/.rbenv/versions/2.4.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-15
  - GEM PATHS:
     - /Users/millan/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0
     - /Users/millan/.gem/ruby/2.4.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
@claudiob

This comment has been minimized.

Copy link

commented Feb 25, 2017

I can confirm the above is happening even with the latest version of Rubygems.

In my case, I had both Rails 5.0.0 and 5.0.1 already installed on my machine and in this Gist you can see the output of the command:

DEBUG_RESOLVER=1 MOLINILLO_DEBUG=1 gem install --pre rails -v 5.1.0.beta1 --backtrace --debug

It looks like actionpack 5.1.0.beta1 is specifically requiring actionpack 5.1.0.beta1.
However the resolver is trying to match different versions of actionpack and, in the end, fail with a conflict.

I haven't found the exact culprit but it might be related to this change that was included in rubygems 2.6.8: v2.6.7...v2.6.8diff-497e339bac125e58f5e42c03ab6ea9a7R325 that affects the resolution order in case of prerelase.

@segiddins

This comment has been minimized.

Copy link
Member

commented Feb 25, 2017

Let me see if Releasing a new Molinillo fixes this...

@jcoyne

This comment has been minimized.

Copy link

commented Feb 28, 2017

I'm seeing this also with Rails 5.0.2.rc1

@segiddins

This comment has been minimized.

Copy link
Member

commented Feb 28, 2017

I have a resolver fix for this (using the improved sorting algorithm that bundler uses)

@segiddins

This comment has been minimized.

Copy link
Member

commented Feb 28, 2017

#1856 should fix the issue

@HoracioChavez

This comment has been minimized.

Copy link

commented Mar 3, 2017

Just for reference: #1653 (comment)

homu added a commit that referenced this issue Mar 11, 2017
Auto merge of #1856 - rubygems:seg-resolver-sorting, r=segiddins
[Resolver] Use improved bundler sorting algorithm

# Description:

Fixes #1851

# Tasks:

- [ ] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).

@homu homu closed this in #1856 Mar 11, 2017

segiddins added a commit that referenced this issue Mar 17, 2017
Auto merge of #1856 - rubygems:seg-resolver-sorting, r=segiddins
[Resolver] Use improved bundler sorting algorithm

# Description:

Fixes #1851

# Tasks:

- [ ] Describe the problem / feature
- [ ] Write tests
- [ ] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).

(cherry picked from commit fa87e95)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.