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
Closed

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

Najtmare opened this issue Feb 24, 2017 · 6 comments

Comments

@Najtmare
Copy link

Najtmare 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
Copy link

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.8#diff-497e339bac125e58f5e42c03ab6ea9a7R325 that affects the resolution order in case of prerelase.

@segiddins
Copy link
Member

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

@jcoyne
Copy link

jcoyne commented Feb 28, 2017

I'm seeing this also with Rails 5.0.2.rc1

@segiddins
Copy link
Member

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

@segiddins
Copy link
Member

#1856 should fix the issue

@HoracioChavez
Copy link

HoracioChavez commented Mar 3, 2017

Just for reference: #1653 (comment)

homu added a commit that referenced this issue Mar 11, 2017
[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).
segiddins pushed a commit that referenced this issue Mar 17, 2017
[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
Projects
None yet
Development

No branches or pull requests

6 participants