Skip to content

Gem Resolution Errors from Gemspec #2596

jamie opened this Issue Aug 14, 2013 · 5 comments

7 participants

jamie commented Aug 14, 2013

I'm wiring up some code into a rails engine, and I have the following Gemfile:

source ''

The associated example.gemspec looks something like this (minimal failing case):

# Describe your gem and declare its dependencies: do |s|        = "example"
  s.version     = '0.0.1'

  s.add_dependency "nokogiri", "<1.6"
  s.add_dependency "capybara", "~> 2.0.0"

I'm specifically aiming for those versions due to ruby 1.8 compatability. Latest capybara depends on nokogiri >=1.3.3, and capybara's dependencies depend on nokogiri ~>1.3 and ~>1.5, so that shouldn't be a problem. However, when I attempt to bundle this, I get the following:

Fetching gem metadata from
Fetching gem metadata from
Resolving dependencies...
Bundler could not find compatible versions for gem "nokogiri":
  In Gemfile:
    example (>= 0) ruby depends on
      nokogiri (< 1.6) ruby

    capybara (~> 2.0.0) ruby depends on
      nokogiri (1.6.0)

If I instead pull the gem requirements direct into the Gemfile like so, it bundles just fine with nokogiri 1.5.10:

source ''
gem "nokogiri", "<1.6"
gem "capybara", "~> 2.0.0"

(Also, changing the gemspec to require nokogiri ~> 1.5.0 works too).

Bundler 1.3.5, same error under 1.4.0.pre.1. Ruby 1.8.7p358, rubygems 1.8.24.

Bundler member

This sounds similar to #2593. Possibly the same underlying cause.


Similar to #2122 also (which has an example of a better way to construct a repro for this case).

@balexand balexand referenced this issue in aws/aws-sdk-ruby Oct 31, 2013

Conflict on Nokogiri with Capybara #315


I've been having this problem due to a supposed conflict between aws-sdk and capybara. I worked around it by upgrading bundler and explicitly declaring a nokogiri version in my Gemfile (gem 'nokogiri', '1.5.10').

Bundler member
Who828 commented Dec 4, 2013

This issue is fixed in #2726 (


I've had similar problem.
FWIW I've created small script to reproduce it

@indirect indirect closed this Jan 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.