From 9962780541e794deaabfa31da22ba418f03a0750 Mon Sep 17 00:00:00 2001 From: Yuji Nakayama Date: Fri, 27 Dec 2013 12:15:44 +0900 Subject: [PATCH 1/2] Fix rspec gem dependency Problem ======= With the current rspec dependency definition in guard-rspec: s.add_dependency 'rspec', '>= 2.14', '~> 3.0.0.beta', '< 4.0' And a Gemfile in another project: gem 'rspec', '~> 2.14' gem 'guard-rspec', '~> 4.2.2' Then run Bundler: $ bundle update Fetching gem metadata from https://rubygems.org/......... Fetching additional metadata from https://rubygems.org/.. Resolving dependencies... Bundler could not find compatible versions for gem "rspec": In Gemfile: rspec (~> 2.14) ruby guard-rspec (~> 4.2.2) ruby depends on rspec (3.0.0.beta1) This means the '~> 3.0.0.beta' negates the '>= 2.14'. Solution ======== If guard-rspec defines: s.add_dependency 'rspec', '>= 2.14', '< 4.0' This works in another project: gem 'rspec', '~> 2.14' gem 'guard-rspec', '~> 4.2.2' And this also works: gem 'rspec', '~> 3.0.0.beta1' gem 'guard-rspec', '~> 4.2.2' --- guard-rspec.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guard-rspec.gemspec b/guard-rspec.gemspec index 8572095f..c2007a35 100644 --- a/guard-rspec.gemspec +++ b/guard-rspec.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.add_dependency 'guard', '~> 2.1', '>= 2.1' - s.add_dependency 'rspec', '>= 2.14', '~> 3.0.0.beta', '< 4.0' + s.add_dependency 'rspec', '>= 2.14', '< 4.0' s.add_development_dependency 'bundler', '~> 1.3', '>= 1.3.5' s.add_development_dependency 'rake', '~> 10.1' From 6e7fa790b884fb8d910f5b9f34a2b8aed5317aff Mon Sep 17 00:00:00 2001 From: Yuji Nakayama Date: Fri, 27 Dec 2013 12:17:03 +0900 Subject: [PATCH 2/2] Improve other dependencies '~> 2.1' is equivalent of '>= 2.1', '< 3.0'. --- guard-rspec.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guard-rspec.gemspec b/guard-rspec.gemspec index c2007a35..e956e515 100644 --- a/guard-rspec.gemspec +++ b/guard-rspec.gemspec @@ -17,10 +17,10 @@ Gem::Specification.new do |s| s.test_files = s.files.grep(%r{^spec/}) s.require_path = 'lib' - s.add_dependency 'guard', '~> 2.1', '>= 2.1' + s.add_dependency 'guard', '~> 2.1' s.add_dependency 'rspec', '>= 2.14', '< 4.0' - s.add_development_dependency 'bundler', '~> 1.3', '>= 1.3.5' + s.add_development_dependency 'bundler', '>= 1.3.5', '< 2.0' s.add_development_dependency 'rake', '~> 10.1' s.add_development_dependency 'launchy', '~> 2.4' end