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

Conflicting platform dependencies #5340

Closed
deivid-rodriguez opened this issue Jan 21, 2017 · 9 comments
Closed

Conflicting platform dependencies #5340

deivid-rodriguez opened this issue Jan 21, 2017 · 9 comments
Assignees
Milestone

Comments

@deivid-rodriguez
Copy link
Member

deivid-rodriguez commented Jan 21, 2017

If I run

$ bundle
$ bundle exec rake --version

I get the following error

Bundler could not find compatible versions for gem "concurrent-ruby":
  In snapshot (Gemfile.lock):
    concurrent-ruby (= 1.0.4) java

  In Gemfile:
    activeadmin java was resolved to 1.0.0, which depends on
      sprockets (< 4.1) java was resolved to 3.7.1, which depends on
        concurrent-ruby (~> 1.0) java

    activeadmin java was resolved to 1.0.0, which depends on
      sprockets (< 4.1) java was resolved to 3.7.1, which depends on
        concurrent-ruby (~> 1.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

When using the following setup

Environment

Bundler   1.14.0
Rubygems  2.6.8
Ruby      2.3.1p0 (2017-01-11 revision 54768) [java]
GEM_HOME  /home/deivid/.gem/jruby/2.3.1
GEM_PATH  /home/deivid/.gem/jruby/2.3.1:/home/deivid/.rubies/jruby-9.1.7.0/lib/ruby/gems/shared
Git       2.11.0
Platform  universal-java-1.8

Bundler settings

gem.test
  Set for the current user (/home/deivid/.bundle/config): "rspec"
gem.mit
  Set for the current user (/home/deivid/.bundle/config): "true"
gem.coc
  Set for the current user (/home/deivid/.bundle/config): "true"

Gemfile

Gemfile

source "https://rubygems.org"

gemspec

platform :ruby_19 do
  gem 'kaminari', '~> 0.15'
  gem 'mime-types', '< 3'
  gem 'nokogiri', '< 1.7'
  gem 'public_suffix', '< 1.5'
end

Gemfile.lock

<No /home/deivid/Code/test/Gemfile.lock found>

Gemspecs

activeadmin.gemspec

Gem::Specification.new do |s|
  s.name          = 'activeadmin'
  s.license       = 'MIT'
  s.version       = '1.0.0'
  s.homepage      = 'http://activeadmin.info'
  s.authors       = ['Greg Bell']
  s.email         = ['[email protected]']
  s.description   = 'The administration framework for Ruby on Rails.'
  s.summary       = 'The administration framework for Ruby on Rails.'

  s.required_ruby_version = '>= 1.9.3'

  s.add_dependency 'arbre',               '~> 1.0', '>= 1.0.2'
  s.add_dependency 'bourbon'
  s.add_dependency 'coffee-rails'
  s.add_dependency 'formtastic',          '~> 3.1'
  s.add_dependency 'formtastic_i18n'
  s.add_dependency 'inherited_resources', '~> 1.6'
  s.add_dependency 'jquery-rails'
  s.add_dependency 'jquery-ui-rails'
  s.add_dependency 'kaminari',            '>= 0.15', '< 2.0'
  s.add_dependency 'railties',            '>= 3.2', '< 5.1'
  s.add_dependency 'ransack',             '~> 1.3'
  s.add_dependency 'sass-rails'
  s.add_dependency 'sprockets',           '< 4.1'
end

Bug?

@segiddins
Copy link
Member

Try adding source "https://rubygems.org" to your Gemfile

@deivid-rodriguez
Copy link
Member Author

Same problem, edited the description to add that line.

@segiddins
Copy link
Member

Thanks, had to actually switch to jruby to reproduce (was previously hacking the platform in). Have a fix locally, just need to write a test

@segiddins
Copy link
Member

Can you try #5343? I think that'll fix it :D

@deivid-rodriguez
Copy link
Member Author

Tried it, it worked! ❤️ Also run the specs and got the same failure as the one Travis is running into.

@segiddins segiddins modified the milestones: 1.114.2, 1.14.2 Jan 22, 2017
bundlerbot added a commit that referenced this issue Jan 22, 2017
[Definition] Converge sources before anything else

Fixes #5340

Improves handling of gemspec sources by ensuring they're converged before anything else, and also converging the locked dependency sources so that `dependencies_for_source_changed?` doesn't get tripped up

- [x] test coverage
segiddins pushed a commit that referenced this issue Jan 23, 2017
[Definition] Converge sources before anything else

Fixes #5340

Improves handling of gemspec sources by ensuring they're converged before anything else, and also converging the locked dependency sources so that `dependencies_for_source_changed?` doesn't get tripped up

- [x] test coverage

(cherry picked from commit 3e5d59a)
@segiddins
Copy link
Member

Fix released as 1.14.2

@nomoon
Copy link

nomoon commented Jan 23, 2017

I seem to still be getting this error with Bundler 1.14.2 and JRuby (ruby-concurrency/thread_safe#29)

Environment

Bundler   1.14.2
Rubygems  2.6.8
Ruby      2.3.1p0 (2016-11-09 revision 54768) [java]
GEM_HOME  /Users/nomoon/.rvm/gems/jruby-9.1.6.0@thread_safe
GEM_PATH  /Users/nomoon/.rvm/gems/jruby-9.1.6.0@thread_safe:/Users/nomoon/.rvm/gems/jruby-9.1.6.0@global
RVM       1.28.0 (latest)
Git       2.11.0
Platform  universal-java-1.8
rubygems-bundler (1.4.4)

Bundler settings

build.eventmachine
  Set for the current user (/Users/nomoon/.bundle/config): "--with-cppflags=-I/usr/local/opt/openssl/include"
gem.test
  Set for the current user (/Users/nomoon/.bundle/config): "rspec"
gem.coc
  Set for the current user (/Users/nomoon/.bundle/config): "true"
gem.mit
  Set for the current user (/Users/nomoon/.bundle/config): "true"
local.readthis
  Set for the current user (/Users/nomoon/.bundle/config): "/Users/nomoon/LocalDev/readthis"
force_ruby_platform
  Set for the current user (/Users/nomoon/.bundle/config): "false"

Gemfile

Gemfile

source 'https://rubygems.org'

gemspec

group :development, :test do
  gem 'rspec', '~> 3.2.0'
  gem 'simplecov', '~> 0.9.2', :require => false
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
    gem 'term-ansicolor', '~> 1.3.2', :require => false
    gem 'tins', '~> 1.6.0', :require => false
  end
  gem 'coveralls', '~> 0.7.11', :require => false
end

group :documentation do
  gem 'countloc', '~> 0.4.0', :platforms => :mri, :require => false
  gem 'yard', '~> 0.8.7.6', :require => false
  gem 'inch', '~> 0.5.10', :platforms => :mri, :require => false
  gem 'redcarpet', '~> 3.2.2', platforms: :mri # understands github markdown
end

Gemfile.lock

PATH
  remote: .
  specs:
    thread_safe (0.3.5-java)

GEM
  remote: https://rubygems.org/
  specs:
    atomic (1.1.16-java)
    coveralls (0.7.12)
      multi_json (~> 1.10)
      rest-client (>= 1.6.8, < 2)
      simplecov (~> 0.9.1)
      term-ansicolor (~> 1.3)
      thor (~> 0.19.1)
    diff-lcs (1.3)
    docile (1.1.5)
    domain_name (0.5.20161129)
      unf (>= 0.0.5, < 1.0.0)
    http-cookie (1.0.3)
      domain_name (~> 0.5)
    mime-types (2.99.3)
    multi_json (1.12.1)
    netrc (0.11.0)
    rake (11.3.0)
    rest-client (1.8.0)
      http-cookie (>= 1.0.2, < 2.0)
      mime-types (>= 1.16, < 3.0)
      netrc (~> 0.7)
    rspec (3.2.0)
      rspec-core (~> 3.2.0)
      rspec-expectations (~> 3.2.0)
      rspec-mocks (~> 3.2.0)
    rspec-core (3.2.3)
      rspec-support (~> 3.2.0)
    rspec-expectations (3.2.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.2.0)
    rspec-mocks (3.2.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.2.0)
    rspec-support (3.2.2)
    simplecov (0.9.2)
      docile (~> 1.1.0)
      multi_json (~> 1.0)
      simplecov-html (~> 0.9.0)
    simplecov-html (0.9.0)
    term-ansicolor (1.4.0)
      tins (~> 1.0)
    thor (0.19.4)
    tins (1.13.0)
    unf (0.1.4-java)
    yard (0.8.7.6)

PLATFORMS
  java

DEPENDENCIES
  atomic (= 1.1.16)
  countloc (~> 0.4.0)
  coveralls (~> 0.7.11)
  inch (~> 0.5.10)
  rake (< 12.0)
  redcarpet (~> 3.2.2)
  rspec (~> 3.2.0)
  simplecov (~> 0.9.2)
  thread_safe!
  yard (~> 0.8.7.6)

BUNDLED WITH
   1.14.2

Gemspecs

thread_safe.gemspec

# -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__) unless $:.include?('lib')
require 'thread_safe/version'

Gem::Specification.new do |gem|
  gem.authors       = ["Charles Oliver Nutter", "thedarkone"]
  gem.email         = ["[email protected]", "[email protected]"]
  gem.summary       = %q{Thread-safe collections and utilities for Ruby}
  gem.description   = %q{A collection of data structures and utilities to make thread-safe programming in Ruby easier}
  gem.homepage      = "https://github.com/ruby-concurrency/thread_safe"

  gem.files         = `git ls-files`.split($\)
  gem.files        += ['lib/thread_safe/jruby_cache_backend.jar'] if defined?(JRUBY_VERSION)
  gem.files        -= ['.gitignore'] # see https://github.com/headius/thread_safe/issues/40#issuecomment-42315441
  gem.platform      = 'java' if defined?(JRUBY_VERSION)
  gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
  gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
  gem.name          = "thread_safe"
  gem.require_paths = ["lib"]
  gem.version       = ThreadSafe::VERSION
  gem.license       = "Apache-2.0"

  gem.add_development_dependency 'atomic', '= 1.1.16'
  gem.add_development_dependency 'rake', '< 12.0'
  gem.add_development_dependency 'rspec', '~> 3.2'
end
$ bundle install
The dependency countloc (~> 0.4.0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for java but the dependency is only for ruby. To add those platforms to the bundle, run `bundle lock --add-platform mri`.
The dependency inch (~> 0.5.10) will be unused by any of the platforms Bundler is installing for. Bundler is installing for java but the dependency is only for ruby. To add those platforms to the bundle, run `bundle lock --add-platform mri`.
The dependency redcarpet (~> 3.2.2) will be unused by any of the platforms Bundler is installing for. Bundler is installing for java but the dependency is only for ruby. To add those platforms to the bundle, run `bundle lock --add-platform mri`.
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Installing rake 11.3.0
Installing atomic 1.1.16 (java)
Installing multi_json 1.12.1
Installing unf 0.1.4 (java)
Installing mime-types 2.99.3
Installing netrc 0.11.0
Installing docile 1.1.5
Installing simplecov-html 0.9.0
Installing tins 1.13.0
Installing thor 0.19.4
Installing diff-lcs 1.3
Installing rspec-support 3.2.2
Using thread_safe 0.3.5 (java) from source at `.`
Installing yard 0.8.7.6
Using bundler 1.14.2
Installing domain_name 0.5.20161129
Installing simplecov 0.9.2
Installing term-ansicolor 1.4.0
Installing rspec-core 3.2.3
Installing rspec-expectations 3.2.1
Installing rspec-mocks 3.2.1
Installing http-cookie 1.0.3
Installing rspec 3.2.0
Installing rest-client 1.8.0
Installing coveralls 0.7.12
Bundle complete! 10 Gemfile dependencies, 25 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

$ bundle exec rake -T
Bundler could not find compatible versions for gem "unf":
  In snapshot (Gemfile.lock):
    unf (= 0.1.4) java

  In Gemfile:
    coveralls (~> 0.7.11) java was resolved to 0.7.12, which depends on
      rest-client (< 2, >= 1.6.8) java was resolved to 1.8.0, which depends on
        http-cookie (< 2.0, >= 1.0.2) java was resolved to 1.0.3, which depends on
          domain_name (~> 0.5) java was resolved to 0.5.20161129, which depends on
            unf (< 1.0.0, >= 0.0.5) java

    coveralls (~> 0.7.11) java was resolved to 0.7.12, which depends on
      rest-client (< 2, >= 1.6.8) java was resolved to 1.8.0, which depends on
        http-cookie (< 2.0, >= 1.0.2) java was resolved to 1.0.3, which depends on
          domain_name (~> 0.5) java was resolved to 0.5.20161129, which depends on
            unf (< 1.0.0, >= 0.0.5)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

@segiddins
Copy link
Member

@nomoon please open a new issur

@nomoon
Copy link

nomoon commented Jan 23, 2017

10-4

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

3 participants