# Ruby claims "Unable to resolve dependencies" when they are met

**URL:** <https://www.ruby-forum.com/t/ruby-claims-unable-to-resolve-dependencies-when-they-are-met/233392>\
**Category:** Ruby\
**Created:** [December 10, 2014, 3:44am UTC](https://www.ruby-forum.com/t/ruby-claims-unable-to-resolve-dependencies-when-they-are-met/233392 "2014-12-10T03:44:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [December 10, 2014, 3:44am UTC](https://www.ruby-forum.com/t/ruby-claims-unable-to-resolve-dependencies-when-they-are-met/233392/1 "2014-12-10T03:44:24Z")

</div>

I tried installing beaker-rspec and it was failing with:

```
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: rspec requires rspec-core (~>
2.99.0), rspec-expectations (~> 2.99.0), rspec-mocks (~> 2.99.0)

```

Despite the fact those Gems are already installed:

# gem list |grep rspec

rspec (3.1.0)  
rspec-core (3.1.7)  
rspec-expectations (3.1.2)  
rspec-its (1.1.0)  
rspec-mocks (3.1.3)  
rspec-puppet (1.0.1)  
rspec-support (3.1.2)  
serverspec (2.7.0)

I tried to force it with --no-dependencies and manually installing  
dependencies but I get this error when I run it:

usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to\_specs’: Could not  
find serverspec (~\> 1.0) amongst [CFPropertyList-2.2.8, active  
support-4.1.8, addressable-2.3.6, akami-1.2.2,  
archive-tar-minitar-0.5.2, autoparse-0.3.3, aws-sdk-1.59.1,  
aws-sdk-v1-1.59.1, backport  
s-3.6.4, backports-3.6.0, beaker-2.0.0, beaker-rspec-4.0.0,  
builder-3.2.2, bundle-0.0.1, bundler-1.7.8, bundler-1.7.7,  
chronic\_duratio  
n-0.10.6, cucumber-1.3.17, cucumber-puppet-0.3.7, daemons-1.1.9,  
diff-lcs-1.2.5, docile-1.1.5, docker-api-1.17.0, eventmachine-1.0.3,  
excon-0.42.1, extlib-0.9.16, facter-2.3.0, facter-1.7.6, fakefs-0.6.0,  
faraday-0.9.0, fission-0.5.0, fog-1.25.0, fog-brightbox-0.7.1,  
fog-core-1.25.0, fog-json-1.0.0, fog-profitbricks-0.0.1,  
fog-radosgw-0.0.3, fog-sakuracloud-0.1.1, fog-softlayer-0.3.25,  
fog-terremark  
-0.0.3, fog-vmfusion-0.0.1, fog-voxel-0.0.2, fog-xml-0.1.1,  
formatador-0.2.5, gem-man-0.3.0, gherkin-2.12.2,  
google-api-client-0.7.1,  
gyoku-1.2.2, gyoku-1.1.0, hiera-1.3.4, hiera-puppet-1.0.0,  
hiera-puppet-helper-1.0.1, highline-1.6.21, hocon-0.0.6, httpi-2.3.0,  
httpi  
-2.2.5, i18n-0.6.11, inflecto-0.0.2, inifile-3.0.0, inifile-2.0.2,  
ipaddress-0.8.0, json-1.8.1, json\_pure-1.8.1, jwt-1.2.0, kramdown-1  
.5.0, launchy-2.4.3, logutils-0.6.1, macaddr-1.7.1, markdown-1.2.0,  
metaclass-0.0.4, mime-types-2.4.3, mime-types-1.25.1, mini\_portile  
-0.6.1, mini\_portile-0.6.0, mini\_portile-0.5.3, minitest-5.4.3,  
mocha-1.1.0, multi\_json-1.10.1, multi\_test-0.1.1, multipart-post-2.0.0  
, net-scp-1.2.1, net-ssh-2.9.1, netrc-0.9.0, netrc-0.8.0,  
nokogiri-1.6.5, nori-2.4.0, numerizer-0.2.0, numerizer-0.1.1,  
opennebula-4.1  
0.1, props-1.1.2, puppet-2.7.26, puppet-lint-1.1.0, puppet-syntax-1.3.0,  
puppetlabs\_spec\_helper-0.8.2, rack-1.5.2, rake-10.4.2, rbvmom  
i-1.8.2, rbvmomi-1.8.1, rest-client-1.7.2, retriable-1.4.1, rspec-3.1.0,  
rspec-core-3.1.7, rspec-expectations-3.1.2, rspec-its-1.1.0,  
rspec-mocks-3.1.3, rspec-puppet-1.0.1, rspec-support-3.1.2,  
rubyzip-1.1.6, rvc-1.8.0, savon-2.8.0, savon-2.6.0, serverspec-2.7.0,  
sign  
et-0.6.0, simplecov-0.9.1, simplecov-html-0.8.0, spec-5.3.4,  
specinfra-2.10.2, systemu-2.6.4, templater-1.0.0, terminal-table-1.4.5,  
t  
extutils-0.10.0, thin-1.6.3, thread\_safe-0.3.4, trollop-2.0,  
tzinfo-1.2.2, unf-0.1.4, unf\_ext-0.0.6, uuid-2.3.7, uuidtools-2.1.5,  
wasa  
bi-3.3.1, wasabi-3.3.0, yard-0.8.7.6, zip-2.0.2] (Gem::LoadError)

I’ve tried gem pristine --all and re-installing rubygems package but  
it’s still failing.

---

<div class="post-metadata">

**Author:** ![patrickreilly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@patrickreilly](https://www.ruby-forum.com/u/patrickreilly)\
**Post date:** [December 10, 2014, 11:56am UTC](https://www.ruby-forum.com/t/ruby-claims-unable-to-resolve-dependencies-when-they-are-met/233392/2 "2014-12-10T11:56:27Z")

</div>

your problem is:

“rspec-core (~\>2.99.0)” does not match “rspec-core (3.1.7)”  
same with  
“serverspec (~\> 1.0)” does not match “serverspec (2.7.0)”

for you, you might need to investigate, what does require something else  
in your list

i did look and the problem is that “beaker-rspec” does need an older  
version of “serverspec” and that does need an older version of rspec …

the problem is also that “beaker-rspec” does require rspec before  
“serverspec” which makes it even more broken …

for you: imo “beaker-rspec” itself does need to be fixed, but i cant  
help you with that

---

<div class="post-metadata">

**Author:** ![patrickreilly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@patrickreilly](https://www.ruby-forum.com/u/patrickreilly)\
**Post date:** [December 10, 2014, 10:37pm UTC](https://www.ruby-forum.com/t/ruby-claims-unable-to-resolve-dependencies-when-they-are-met/233392/3 "2014-12-10T22:37:47Z")

</div>

Thanks very much for your help, I wasn’t familiar with the ~\> syntax and  
read up on it after your post. I was confused though by the rspec  
requirement, since beaker-rspec doesn’t peg a version. Again thanks for  
your help I’ll log an issue with the beaker-rspec maintainers.
