Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add rake dependency if bundler has already added it #84

Closed
slmingol opened this issue Nov 11, 2014 · 5 comments
Closed

Don't add rake dependency if bundler has already added it #84

slmingol opened this issue Nov 11, 2014 · 5 comments
Labels

Comments

@slmingol
Copy link

Methadone makes the following gemspec:

...
  spec.add_development_dependency "bundler", "~> 1.6"
  spec.add_development_dependency "rake", "~> 10.0"
  spec.add_development_dependency('rdoc')
  spec.add_development_dependency('aruba')
  spec.add_development_dependency('rake')
  spec.add_dependency('methadone', '~> 1.8.0')

Which results in this msg:

$ bundle install
Resolving dependencies...
Using rake 10.3.2
Using ffi 1.9.6
Using childprocess 0.5.5
Using builder 3.2.2
Using diff-lcs 1.2.5
Using multi_json 1.10.1
Using gherkin 2.12.2
Using multi_test 0.1.1
Using cucumber 1.3.17
Using rspec-support 3.1.2
Using rspec-expectations 3.1.2
Using aruba 0.6.1
Using bundler 1.6.4
Using methadone 1.8.0

fullstop at /home/slm/fullstop did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
  duplicate dependency on rake (>= 0, development), (~> 10.0) use:
    add_runtime_dependency 'rake', '>= 0', '~> 10.0'
Using fullstop 0.0.1 from source at .
Using json 1.8.1
Using rdoc 4.1.2
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

Taking out the extra restriction about rake: spec.add_development_dependency "rake", "~> 10.0" makes the msg go away. Why is this restriction in the gemspec?

@davetron5000
Copy link
Owner

I think later versions of bundler add that dependency, and so methadone no longer needs to. Methadone should only be adding an open dependency, though: https://github.com/davetron5000/methadone/blob/master/bin/methadone#L82

This was new in 1.8.0, released last month: https://github.com/davetron5000/methadone/releases/tag/v1.8.0

@slmingol
Copy link
Author

OK, I'm using 1.8.0 of Methadone and Bundler is at 1.6.4. Should methadone 1.8.0 not have added this rule?

  spec.add_development_dependency "rake", "~> 10.0"

Sorry this is all fairly new/foreign to me so I'm trying to make heads or tails of what's what.

@davetron5000
Copy link
Owner

A fresh install of methadone on bundler 1.5.3 adds a rake dependency without the version specifier, so it's possible its bundler.

I think the problem is that older versions of bundler didn't add a rake specifier at all, and now they do. Since methadone uses bundler under the covers to bootstrap the gem, and also just inserts a rake dependency to cover its bases, I think that's the problem.

So, I think the ultimate bug here is that methadone should ony add the rake dependency if it's not in the gemspec already. That way, for older versions of bundler, it would add it, but newer it would see it an not.

Gonna change the title of this issue to match and mark it as a bug. Even thought it's minor, there's no need to cause confusion—methadone is supposed to help you :)

@davetron5000 davetron5000 changed the title Encounter an error using fullstop tutorial Don't add rake dependency if bundler has already added it Nov 12, 2014
@slmingol
Copy link
Author

Thanks Dave. Been going through your free ibook too. Very helpful. Thanks for your hard work, it's appreciated. Will be picking up a printed copy of the PragPub book as a thank you!

@davetron5000
Copy link
Owner

This has been fixed (not sure when), but methadone won't result in rake being in the gemspec twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants