I'm wiring up some code into a rails engine, and I have the following Gemfile:
The associated example.gemspec looks something like this (minimal failing case):
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "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 https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Bundler could not find compatible versions for gem "nokogiri":
example (>= 0) ruby depends on
nokogiri (< 1.6) ruby
capybara (~> 2.0.0) ruby depends on
If I instead pull the gem requirements direct into the Gemfile like so, it bundles just fine with nokogiri 1.5.10:
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.
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).
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').
gem 'nokogiri', '1.5.10'
This issue is fixed in #2726 (http://pastebin.com/QJpXwQuW).
I've had similar problem.
FWIW I've created small script to reproduce it http://pastebin.com/9gR2ScS5