Jeweler adds circular dependency to my gem
Asked Answered
R

1

10

Gem's(gemfoo) jeweler declaration in Rakefile looks like that:

Jeweler::Tasks.new do |gem|
  #truncated
  gem.add_runtime_dependency 'nokogiri', '~> 1.4.1'
  gem.add_development_dependency 'jeweler'
end                             

The problem is that it generates the following dependencies in the gemfoo.gemspec file:

s.add_runtime_dependency(%q<gemfoo>, [">= 0"]) s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.1"]) s.add_development_dependency(%q<jeweler>, [">= 0"])

Which won't stop you from releasing your rubygem but won't allow you to install it:

gem install gemfoo
ERROR:  Error installing gemfoo:
    gemfoo requires gemfoo (>= 0)

How can I fix that?


jeweler 1.6.0

Ranice answered 12/5, 2011 at 17:7 Comment(1)
Seeing the truncated part from your Rakefile might help. Seems strange that the gem itself is a dependency.Knickers
S
1

Something is broken in your Rakefile. Jeweler 1.6.0


require 'jeweler'
Jeweler::Tasks.new do |gem|
  gem.name = "gemfoo"
  gem.summary = %Q{TODO: one-line summary of your gem}
  gem.description = %Q{TODO: longer description of your gem}
  gem.email = "[email protected]"
  gem.homepage = "http://www.google.com/"
  gem.authors = ["John Doe"]
  gem.add_runtime_dependency 'nokogiri', '~> 1.4.1'
  gem.add_development_dependency 'jeweler'
end
Jeweler::RubygemsDotOrgTasks.new

rake gemspec - the generated gemspec file doesn't have the artifact you're describing.

Squireen answered 16/5, 2011 at 14:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.