SaltwaterC / serverspec-aws

Serverspec resources for AWS
Other
12 stars 9 forks source link

Bundler reports that gemspec is not valid #1

Closed temyers closed 8 years ago

temyers commented 8 years ago

Attempting to build serverspec-aws fails with the following error

WARNING:  See http://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    duplicate dependency on aws-sdk (~> 2), (~> 2) use:
    add_runtime_dependency 'aws-sdk', '~> 2', '~> 2'

Here's my environment:


$ gem list

**\* LOCAL GEMS ***

ansible_spec (0.2.8, 0.2.6)
ast (2.2.0)
aws-sdk (2.2.18, 2.2.16)
aws-sdk-core (2.2.18, 2.2.16)
aws-sdk-resources (2.2.18, 2.2.16)
aws-sdk-v1 (1.66.0)
bigdecimal (1.2.6)
builder (3.2.2)
bundler (1.11.2)
bundler-unload (1.0.2)
ci_reporter (2.0.0)
ci_reporter_rspec (1.0.0)
ci_reporter_test_unit (1.0.0)
coderay (1.1.1)
diff-lcs (1.2.5)
executable-hooks (1.3.2)
ffi (1.9.10)
formatador (0.2.5)
gem-wrappers (1.2.7)
guard (2.13.0)
guard-compat (1.2.1)
guard-rspec (4.6.4)
guard-rubocop (1.2.0)
hostlist_expression (0.2.1)
io-console (0.4.3)
jmespath (1.1.3)
json (1.8.3, 1.8.1)
listen (3.0.6)
lumberjack (1.0.10)
method_source (0.8.2)
mini_portile2 (2.0.0)
multi_json (1.11.2)
nenv (0.3.0)
net-scp (1.2.1)
net-ssh (3.0.2)
net-telnet (0.1.1)
netaddr (1.5.1, 1.5.0)
nokogiri (1.6.7.2)
notiffany (0.0.8)
oj (2.14.5, 2.14.3)
parser (2.3.0.6)
powerpack (0.1.1)
pry (0.10.3)
psych (2.0.8)
rainbow (2.1.0)
rake (10.5.0, 10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rdoc (4.2.0)
require_all (1.3.3)
rspec (3.4.0)
rspec-core (3.4.3, 3.4.2, 3.4.1)
rspec-expectations (3.4.0)
rspec-its (1.2.0)
rspec-mocks (3.4.1, 3.4.0)
rspec-support (3.4.1)
rubocop (0.37.2)
ruby-progressbar (1.7.5)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
serverspec (2.29.2, 2.29.0, 2.27.0)
sfl (2.2)
shellany (0.0.1)
slop (3.6.0)
specinfra (2.51.1, 2.49.0, 2.47.1)
test-unit (2.5.5)
thor (0.19.1)
unicode-display_width (0.3.1)
yard (0.8.7.6)

$ ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
SaltwaterC commented 8 years ago

Hi. Sorry about that. Should probably take out the gemspec file out of the repo. It is generated by a rake task using jeweler. And, of course, fix the task to generate a proper gemspec.

SaltwaterC commented 8 years ago

Found the issue. jeweler is not checking for duplicates when sourcing the dependencies. It can do this from both the rake task itself and from the supplied Gemfile. The issue is: when a dependency is specified in both places, it'll end up twice in the generated gemspec.

I also removed the gemspec from the repo. To generate a fresh one:

bundle install --with development
rake gemspec

However, the issue was not discovered for so long as I was using the rest of the rake tasks supplied by jeweler which don't use the generated gemspec to build/install the gem. From rake -T:

rake build                 # Build gem into pkg/
rake install               # Build and install gem using `gem install`

Also: for the moment I am not pushing this gem to RubyGems as the integration testing against AWS resources got delayed for quite a while and I don't feel like the work for this gem is complete.

temyers commented 8 years ago

Don't know if this is a separate issue, but according to:

https://github.com/bundler/bundler/issues/1880

In order to include a gem from source, it needs to include a gemspec - even if it's generated.

Or should I be using a different process I'm unaware of?

SaltwaterC commented 8 years ago

I can publish the gem to RubyGems to make things easier for everybody. I'll do this after dealing with your PR #3.

temyers commented 8 years ago

Ok that would be great thanks